Skip to content

Commit

Permalink
Remove shipping_method_id from RestartCheckout, destroying shipments …
Browse files Browse the repository at this point in the history
…is now enough as order.shipping_method_id is no longer used and will be dropped. See openfoodfoundation#2683 for more details
  • Loading branch information
luisramos0 committed Dec 21, 2018
1 parent 1007add commit 7155f28
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/services/restart_checkout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def reset_state_to_cart
end

def clear_shipments
order.update_attributes!(shipping_method_id: nil)
order.shipments.with_state(:pending).destroy_all
end

Expand Down
2 changes: 0 additions & 2 deletions spec/services/restart_checkout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
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

Expand All @@ -28,7 +27,6 @@
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
Expand Down

0 comments on commit 7155f28

Please sign in to comment.