Skip to content

Instantly share code, notes, and snippets.

@AMHOL
Created October 15, 2013 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AMHOL/6988799 to your computer and use it in GitHub Desktop.
Save AMHOL/6988799 to your computer and use it in GitHub Desktop.
Rails STI with Polymorphic relationship fix
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