spree/spree — pull request #5556 by mbj (2014-11-03 13:41:07+00:00)
Title: Fix order / adjustment presence in adjustments

* Fix admin action producing adjustments without direct order reference.
* Add validation for the presence of adjustable
* Adjustments without an adjustable item do not make too much sense
* Add migration to fix old adjustments without direct order reference

This set of changes allows to promote `Order#all_adjustments` to a relation. This step is needed to ultimatively retarget all order specific adjustment reads / writes through this relation. Together with eager loading it gives a huge performance boost and fixes (for us) the deadlog issue as resources under contention will only be accessed through the same object graph.

These set of changes is an iterative improvement.

I'll PR the missing parts step by step to allow discussion.

Our CI passes this set of changes. https://circleci.com/gh/MountainRoseHerbs/spree/392