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

Prefer delegating recalculate without a method #5120

Merged
merged 1 commit into from
Jun 6, 2023
Merged
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
6 changes: 2 additions & 4 deletions core/app/models/spree/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def self.find_by_param!(value)
find_by! number: value
end

delegate :recalculate, to: :recalculator

delegate :name, to: :bill_address, prefix: true, allow_nil: true
alias_method :billing_name, :bill_address_name

Expand Down Expand Up @@ -264,10 +266,6 @@ def recalculator
alias_method :updater, :recalculator
deprecate updater: :recalculator, deprecator: Spree::Deprecation

def recalculate
recalculator.recalculate
end

def assign_billing_to_shipping_address
self.ship_address = bill_address if bill_address
true
Expand Down