Created
December 17, 2010 22:52
-
-
Save dwarfmondo/745853 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
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