Skip to content

Commit 08ac47a

Browse files
committed
Don't "persist_amounts"
This association is autosaved, and Rails knows not to retouch things when autosaving associated records. I did a test to confirm that removing this doesn't change whether the field is persisted. (cherry picked from commit 6106722)
1 parent b0f0f51 commit 08ac47a

2 files changed

Lines changed: 0 additions & 2 deletions

File tree

core/app/models/spree/in_memory_order_updater.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ def recalculate_line_item_prices
236236
end
237237

238238
def persist_totals
239-
shipments.each(&:persist_amounts)
240239
log_state_change("payment")
241240
log_state_change("shipment")
242241
order.save!

core/spec/models/spree/in_memory_order_updater_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,6 @@ module Spree
575575

576576
it "updates the shipment amount" do
577577
expect(shipment).to receive(:assign_amounts)
578-
expect(shipment).to receive(:persist_amounts)
579578
updater.recalculate
580579
end
581580
end

0 commit comments

Comments
 (0)