Skip to content

Remove update_adjustments AR callbacks#1356

Merged
jhawthorn merged 2 commits intosolidusio:masterfrom
jhawthorn:remove_adjustment_callbacks
Aug 16, 2016
Merged

Remove update_adjustments AR callbacks#1356
jhawthorn merged 2 commits intosolidusio:masterfrom
jhawthorn:remove_adjustment_callbacks

Conversation

@jhawthorn
Copy link
Copy Markdown
Contributor

The existing behaviour was that line_items and shipments had their adjustments recalculated after save. This would update the item's adjustments and the item's *_total columns. However this doesn't update the order's *_total columns until order.update! is run.

Since order.update! will update these values anyways, and since the order is in an inconsistent state until order.update! is run, we should remove these callbacks.

Related to #1252

John Hawthorn added 2 commits July 26, 2016 14:35
The existing behaviour was that line_items and shipments had their
adjustments recalculated after save. This would update the item's
adjustments and the item's _total columns. However this doesn't update
the order's _total columns until order.update! is run.

Since order.update! will update these values anyways, and since the
order is in an inconsistent state until order.update! is run, we should
remove these callbacks.
@jhawthorn jhawthorn force-pushed the remove_adjustment_callbacks branch from d4a4dca to fd3dff1 Compare July 26, 2016 22:00
@mamhoff
Copy link
Copy Markdown
Contributor

mamhoff commented Jul 27, 2016

This is excellent. 💯

@jordan-brough
Copy link
Copy Markdown
Contributor

👍 Thank you!

@cbrunsdon
Copy link
Copy Markdown
Contributor

I'm a serious 👍 on this as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants