diff --git a/core/app/models/spree/in_memory_order_updater.rb b/core/app/models/spree/in_memory_order_updater.rb index 9624bff84d..b91f0e3037 100644 --- a/core/app/models/spree/in_memory_order_updater.rb +++ b/core/app/models/spree/in_memory_order_updater.rb @@ -3,6 +3,7 @@ module Spree class InMemoryOrderUpdater attr_reader :order + delegate :payments, :line_items, :adjustments, :all_adjustments, :shipments, :quantity, to: :order def initialize(order) @@ -26,7 +27,8 @@ def recalculate(persist: true) update_shipments recalculate_shipment_state end - Spree::Bus.publish :order_recalculated, order: order + + Spree::Bus.publish(:order_recalculated, order:) persist_totals if persist end @@ -238,8 +240,8 @@ def log_state_change(name) order.state_changes.new( previous_state: old_state, next_state: new_state, - name: name, - user_id: order.user_id + user_id: order.user_id, + name: ) end end