From 9fd5c8d207a54a6a964a608785706a6d7b42c612 Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Fri, 20 Dec 2024 13:09:38 -0800 Subject: [PATCH] Fixup linter errors in InMemoryOrderUpdater Co-Authored-By: Jared Norman Co-Authored-By: benjamin wil Co-Authored-By: Kendra Riga Co-Authored-By: Sofia Besenski --- core/app/models/spree/in_memory_order_updater.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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