Created
February 5, 2011 00:19
-
-
Save maxwell/812057 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 HasPersonProxy | |
module ClassMethods | |
def always_has_one_person | |
self.instance_eval do | |
has_one :person | |
include InstanceMethods | |
alias_method_chain :person, :proxy | |
end | |
end | |
def always_belongs_to_person | |
self.instance_eval do | |
belongs_to :person | |
include InstanceMethods | |
alias_method_chain :person, :proxy | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment