Skip to content

Commit a859efc

Browse files
Noah-Silverakjrigasofiabesenski4forkata
committed
Rename recalculate_ private methods
The `recalculate_adjustments` method rebuilds the adjustments on the order, so it's more accurate to say that it updates instead of saying that it recalculates. Co-Authored-By: Kendra Riga <[email protected]> Co-Authored-By: Sofia Besenski <[email protected]> Co-Authored-By: Chris Todorov <[email protected]>
1 parent d455aab commit a859efc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/app/models/spree/order_updater.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def determine_shipment_state
110110
# fields (promo_total, included_tax_total, additional_tax_total, and
111111
# adjustment_total) on the item.
112112
# @return [void]
113-
def recalculate_adjustments
113+
def update_adjustments
114114
# Promotion adjustments must be applied first, then tax adjustments.
115115
# This fits the criteria for VAT tax as outlined here:
116116
# http://www.hmrc.gov.uk/vat/managing/charging/discounts-etc.htm#1
@@ -120,6 +120,8 @@ def recalculate_adjustments
120120
update_tax_adjustments
121121
recalculate_item_totals
122122
end
123+
alias_method :recalculate_adjustments, :update_adjustments
124+
deprecate recalculate_adjustments: :update_adjustments, deprecator: Spree.deprecator
123125

124126
# Updates the following Order total values:
125127
#
@@ -164,7 +166,7 @@ def recalculate_order_total
164166
deprecate update_order_total: :recalculate_order_total, deprecator: Spree.deprecator
165167

166168
def update_adjustment_total
167-
recalculate_adjustments
169+
update_adjustments
168170

169171
all_items = line_items + shipments
170172
# Ignore any adjustments that have been marked for destruction in our

legacy_promotions/app/patches/models/solidus_legacy_promotions/spree_order_updater_patch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module SolidusLegacyPromotions
44
module SpreeOrderUpdaterPatch
55
def update_adjustment_total
6-
recalculate_adjustments
6+
update_adjustments
77

88
all_items = line_items + shipments
99
order_tax_adjustments = adjustments.select(&:eligible?).select(&:tax?)

0 commit comments

Comments
 (0)