Skip to content

Commit

Permalink
Don't call reload on order
Browse files Browse the repository at this point in the history
The Spree::OrderUpdater sets a bunch of values
on the in-memory instance of Spree::Order.
Calling  here results in various things
not updating (e.g. item count, total count, etc.)
  • Loading branch information
codebycliff authored and przemosk committed Nov 26, 2020
1 parent 14a1ca6 commit 265c739
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class CreateTaxAdjustmentsService < SpreeAvataxOfficial::Base
def call(order:) # rubocop:disable Metrics/AbcSize
return failure(::Spree.t('spree_avatax_official.create_tax_adjustments.order_canceled')) if order.canceled?

order.reload.all_adjustments.tax.destroy_all
order.all_adjustments.tax.destroy_all

return failure(::Spree.t('spree_avatax_official.create_tax_adjustments.tax_calculation_unnecessary')) unless order.avatax_tax_calculation_required?

Expand Down

0 comments on commit 265c739

Please sign in to comment.