Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically update
adjustments
relationships
So that in-memory associations stay up to date for calculations in OrderUpdater and elsewhere. E.g. if you do this: Spree::Adjustment.create!(adjustable: line_item, ...) Then `line_item.adjustments` does not get updated if it's already loaded. Also this: source.adjustments.create!(adjustable: line_item, ...) likewise doesn't update `line_item.adjustments`. The code in this commit is not the most lovely code, but I couldn't think of a better option for the time being, given that we expose all of ActiveRecord as an interface and it's likely that extensions and/or stores themselves have code like the above in, for example, their promotion actions.
- Loading branch information