-
-
Save jessedearing/745862 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Scopes | |
attr_writer :church_id | |
# evaluates to | |
# instance_eval do | |
# def church_id | |
# @church_id | |
# end | |
# def church_id=(value) | |
# @church_id = value | |
# 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