Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove update_adjustments AR callbacks #1356

Merged
merged 2 commits into from
Aug 16, 2016

Conversation

jhawthorn
Copy link
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

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
Contributor

mamhoff commented Jul 27, 2016

This is excellent. 💯

@jordan-brough
Copy link
Contributor

👍 Thank you!

@cbrunsdon
Copy link
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