Skip to content

Instantly share code, notes, and snippets.

@dwarfmondo
Created December 17, 2010 22:52
Show Gist options
  • Save dwarfmondo/745853 to your computer and use it in GitHub Desktop.
Save dwarfmondo/745853 to your computer and use it in GitHub Desktop.
module Scopes
def self.included(klass)
klass.class_eval do
attr_writer :church_id
end
end
end
class User < ActiveRecord::Base
include Scopes
def find
self.find(:first, :conditions => ["church_id = ?", church_id])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment