From 7155f28acf7f30c78c7c90b992158c33e2ea026c Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 21 Dec 2018 14:58:03 +0000 Subject: [PATCH] Remove shipping_method_id from RestartCheckout, destroying shipments is now enough as order.shipping_method_id is no longer used and will be dropped. See #2683 for more details --- app/services/restart_checkout.rb | 1 - spec/services/restart_checkout_spec.rb | 2 -- 2 files changed, 3 deletions(-) diff --git a/app/services/restart_checkout.rb b/app/services/restart_checkout.rb index 79ef9acdb5..4792d070e4 100644 --- a/app/services/restart_checkout.rb +++ b/app/services/restart_checkout.rb @@ -23,7 +23,6 @@ class RestartCheckout end def clear_shipments - order.update_attributes!(shipping_method_id: nil) order.shipments.with_state(:pending).destroy_all end diff --git a/spec/services/restart_checkout_spec.rb b/spec/services/restart_checkout_spec.rb index 1337e2c581..2be21de8b1 100644 --- a/spec/services/restart_checkout_spec.rb +++ b/spec/services/restart_checkout_spec.rb @@ -17,7 +17,6 @@ describe RestartCheckout do let!(:payment_failed) { create(:payment, order: order, state: 'failed') } before do - order.shipping_method_id = shipment_pending.shipping_method_id order.update_attribute(:state, "payment") end @@ -28,7 +27,6 @@ describe RestartCheckout do RestartCheckout.new(order).call expect(order.state).to eq 'cart' - expect(order.shipping_method_id).to eq nil expect(order.shipments.count).to eq 0 expect(order.adjustments.shipping.count).to eq 0 expect(order.payments.count).to eq 1