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

Align some deprecation messages in Order model #3135

Merged
merged 3 commits into from
May 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 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!
recalculate
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,11 @@ 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
1 change: 0 additions & 1 deletion core/spec/models/spree/order_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
before { allow(order).to receive_messages shipments: [shipment] }

it "update and persist totals" do
expect(shipment).to receive :update_amounts
expect(order.updater).to receive :update

Spree::Deprecation.silence do
Expand Down