spree/spree — pull request #3492 by huoxito (2013-08-02 19:50:33+00:00)
Title: Remove `ìnverse_of` from order has_many :adjustments

That option will cause trouble once Spree upgrades to Rails v4.0.0 as
the store will not create proper shipment adjustments. It appears that
`inverse_of: source` will confuse activerecord because an adjustment
source is not always an order. It might be either an Order or a
Shipment for example.

This is the confusing behaviour on rails 4 console session:

[9] pry(Spree):1> order
=> #
[10] pry(Spree):1> shipment
=> #
[11] pry(Spree):1> order.adjustments.create(source: shipment, label: "ha", amount: 0)
=> #

While it also seems like an activerecord bug as well I still believe we
shouldn't rely on `inverse_of` where possible

The `inverse_of` option was introduced in #3054. This PR that same issue using other approach. Please note that the behaviour described above do not exist neither in current master nor in rails4 branch. But it will once the rebase thing happens between master and rails4. I noticed it today while tryign to get the current edge build green on rails 4 and thought I should open this PR so we can remember the issue later on.