I've read in various places that it gets automatically inferred in some circumstances, but I've found the documentation on this feature to be hard to follow. Can anyone shed some light on the principles? Specifically when will Rails be able to infer and when will Rails not be able infer inverses?
I'd like to consider
- polymorphic associations
- single tabled inheritance (e.g. where
BundleProductandIndividualProductboth inherit fromProductand use aproductstable) - regular has_one/has_many/belongs_to associations
- has many through: associations
Some context: I'm maintaining a reasonably large 9-year-old Rails application with many, many tables. I'd like to have some guidance on which models require addition of inverse_of: rather than having to change every model in the system.