Created
October 15, 2013 09:04
-
-
Save AMHOL/6988799 to your computer and use it in GitHub Desktop.
Rails STI with Polymorphic relationship fix
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
def self.inherited(subclass) | |
super(subclass) | |
subclass.send(:class_eval, <<-eoruby, __FILE__, __LINE__ + 1) | |
def self.base_class | |
self | |
end | |
eoruby | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment