Delegate order updater method

This commit is contained in:
Matt-Yorkley
2023-06-05 18:59:32 +01:00
parent 8a27dd84fe
commit 3dd4e7ef03
7 changed files with 9 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ module Api
@shipment.fee_adjustment.fire_events(:open)
if @shipment.update(shipment_params)
@order.updater.update_totals_and_states
@order.update_totals_and_states
end
@shipment.fee_adjustment.close

View File

@@ -115,7 +115,7 @@ class CheckoutController < ::BaseController
end
def update_payment_total
@order.updater.update_totals
@order.update_totals
@order.updater.update_pending_payment
end

View File

@@ -172,7 +172,7 @@ class SplitCheckoutController < ::BaseController
@order.select_shipping_method(params[:shipping_method_id])
@order.update(order_params)
@order.updater.update_totals_and_states
@order.update_totals_and_states
validate_current_step!

View File

@@ -14,7 +14,7 @@ module Spree
def update_order
@order.reload
@order.updater.update_totals_and_states
@order.update_totals_and_states
end
def collection

View File

@@ -58,7 +58,7 @@ module Spree
@order.create_tax_charge!
Spree::TaxRate.adjust(@order, @order.adjustments.admin)
@order.updater.update_totals_and_states
@order.update_totals_and_states
end
def order_params

View File

@@ -83,7 +83,7 @@ module Spree
accepts_nested_attributes_for :shipments
delegate :admin_and_handling_total, :payment_fee, :ship_total, to: :adjustments_fetcher
delegate :update_totals, to: :updater
delegate :update_totals, :update_totals_and_states, to: :updater
delegate :create_line_item_fees!, :create_order_fees!, :update_order_fees!,
:update_line_item_fees!, :recreate_all_fees!, to: :fee_handler
@@ -712,7 +712,7 @@ module Spree
return if adjustment.finalized?
adjustment.update_adjustment!(force: true)
updater.update_totals_and_states
update_totals_and_states
end
end
end

View File

@@ -17,7 +17,7 @@ FactoryBot.define do
after(:create) do |order|
order.line_items << build(:line_item, order: order)
order.updater.update_totals_and_states
order.update_totals_and_states
order.order_cycle.exchanges.outgoing.first.variants << order.line_items.first.variant
end
@@ -49,7 +49,7 @@ FactoryBot.define do
after(:create) do |order|
create(:line_item, order: order)
order.line_items.reload # to ensure order.line_items is accessible after
order.updater.update_totals_and_states
order.update_totals_and_states
end
end