multiple_table_inheritance
multiple_table_inheritance copied to clipboard
Cannot call find_by_* in children if attribute belongs to parent
If I have "title" in my superclass, I can't call "find_by_title" directly from its children. Error I get is that the method doesn't exist.
Hey danivalentin - did you try specifying the :methods
option when calling inherits_from
? Check out the Methods section of the README. Let me know if it still doesn't work.
hi Matt!
yes, I'm using :methods => true. Is there anything else I need to do?
BTW, thanks for the gem!
This sounds like a legitimate bug, but it may pertain to an issue in ActiveRecord as opposed to my gem. The reason I think that may be the case relates to a recent StackOverflow question I opened, in which I learned that ActiveRecord models don't return true
when calling respond_to?
for find_by_*
methods.
This is likely the culprit, but I will verify and see if there is a fix or workaround.