Skip to content

Instantly share code, notes, and snippets.

@pjb3
Created August 31, 2008 17:10
Show Gist options
  • Save pjb3/8199 to your computer and use it in GitHub Desktop.
Save pjb3/8199 to your computer and use it in GitHub Desktop.
class User
belongs_to :group
validates_presence_of :first_name
class << self
def find
"foo"
end
end
def awesome?
false
end
end
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