Rails Guide:"For belongs_to associations, has_many inverse associations are ignored." not clear?

I've never needed :inverse_of. Looks like academic masturbation to me.

It is useful in a small number of situations, mostly where you need to ensure that two different references to the same object actually refer to the same instance. I’ve only needed to use it twice, both times were where we have callbacks updating multiple related objects based on data held in each other.

Anyway, if anyone else does understand what that caveat actually means I’d appreciate an explanation.

I also don’t understand what they mean since the example seems to contradict it…

I also don't understand what they mean since the example seems to contradict it...

Exactly which bit of

seems to be a contradiction? Unless you explain /exactly/ what you do not understand it is difficult to help.

Colin

The example included says…

class Customer < ActiveRecord::Base

has_many :orders, inverse_of: :customer

end

class Order < ActiveRecord::Base

belongs_to :customer, inverse_of: :orders

end