Created
August 31, 2008 17:10
-
-
Save pjb3/8199 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
class User | |
belongs_to :group | |
validates_presence_of :first_name | |
class << self | |
def find | |
"foo" | |
end | |
end | |
def awesome? | |
false | |
end | |
end |
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 UserConcern | |
def self.includes(user) | |
user.extend(ClassMethods) | |
user.class_eval do | |
belongs_to :group | |
validates_presence_of :first_name | |
end | |
end | |
module ClassMethods | |
def find | |
"foo" | |
end | |
end | |
def awesome? | |
false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment