Skip to content

Commit 27e4988

Browse files
stewartjarednormanbenjaminwilkjrigasofiabesenski4
committed
Fixup linter errors in InMemoryOrderUpdater
Co-Authored-By: Jared Norman <[email protected]> Co-Authored-By: benjamin wil <[email protected]> Co-Authored-By: Kendra Riga <[email protected]> Co-Authored-By: Sofia Besenski <[email protected]>
1 parent 7e76070 commit 27e4988

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

core/app/models/spree/in_memory_order_updater.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module Spree
44
class InMemoryOrderUpdater
55
attr_reader :order
6+
67
delegate :payments, :line_items, :adjustments, :all_adjustments, :shipments, :quantity, to: :order
78

89
def initialize(order)
@@ -26,7 +27,8 @@ def recalculate(persist: true)
2627
update_shipments
2728
recalculate_shipment_state
2829
end
29-
Spree::Bus.publish :order_recalculated, order: order
30+
31+
Spree::Bus.publish(:order_recalculated, order:)
3032

3133
persist_totals if persist
3234
end
@@ -238,8 +240,8 @@ def log_state_change(name)
238240
order.state_changes.new(
239241
previous_state: old_state,
240242
next_state: new_state,
241-
name: name,
242-
user_id: order.user_id
243+
user_id: order.user_id,
244+
name:
243245
)
244246
end
245247
end

core/app/models/spree/item_total_updater.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class Spree::ItemTotalUpdater
24
class << self
35
def recalculate(item)

core/spec/models/spree/in_memory_order_updater_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ module Spree
173173
allow(order_adjuster).to receive(:call) { raise NotImplementedError }
174174
allow(Spree::InMemoryOrderUpdater::InMemoryOrderAdjuster).to receive(:new).and_return(order_adjuster)
175175

176-
expect{described_class.new(order).recalculate(persist: false)}
176+
expect{ described_class.new(order).recalculate(persist: false) }
177177
.to raise_error(NotImplementedError)
178178
end
179179
end

core/spec/models/spree/item_total_updater_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
subject { described_class.recalculate(item) }
88

99
let(:item) { create :line_item, adjustments: [adjustment] }
10-
let(:adjustment) { create :adjustment, amount: 1}
10+
let(:adjustment) { create :adjustment, amount: 1 }
1111

1212
it "sets the adjustment total on the item" do
1313
expect { subject }

0 commit comments

Comments
 (0)