Skip to content

Commit

Permalink
Align deprecation messages
Browse files Browse the repository at this point in the history
After update! => recalculate rename.

ref:
- solidusio#1689
- solidusio#2072
  • Loading branch information
elia committed May 10, 2019
1 parent 208febe commit 1d1327e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/app/models/spree/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ def line_item_options_match(line_item, options)

# Creates new tax charges if there are any applicable rates. If prices already
# include taxes then price adjustments are created instead.
# @deprecated This now happens during #update!
# @deprecated This now happens during #recalculate
def create_tax_charge!
Spree::Config.tax_adjuster_class.new(self).adjust!
end
deprecate create_tax_charge!: :update!, deprecator: Spree::Deprecation
deprecate create_tax_charge!: :recalculate, deprecator: Spree::Deprecation

def reimbursement_total
reimbursements.sum(:total)
Expand Down Expand Up @@ -577,11 +577,12 @@ def shipping_eq_billing_address?
bill_address == ship_address
end

# @deprecated This now happens during #recalculate
def set_shipments_cost
shipments.each(&:update_amounts)
recalculate
end
deprecate set_shipments_cost: :update!, deprecator: Spree::Deprecation
deprecate set_shipments_cost: :recalculate, deprecator: Spree::Deprecation

def is_risky?
payments.risky.count > 0
Expand Down

0 comments on commit 1d1327e

Please sign in to comment.