From 2e33e02d7f14cc866dbffe2ec6a09f9931c20638 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Wed, 1 Jul 2020 17:48:43 +0100 Subject: [PATCH] Remove dead code, this method was removed in spree 2.0.4 --- app/models/spree/shipment.rb | 8 -------- spec/models/spree/shipment_spec.rb | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/models/spree/shipment.rb b/app/models/spree/shipment.rb index c5fea38d2c..bff7421c70 100644 --- a/app/models/spree/shipment.rb +++ b/app/models/spree/shipment.rb @@ -315,13 +315,5 @@ module Spree def update_order order.update! end - - # NOTE: This is an override of spree's method, needed to allow orders - # without line items (ie. user invoices) to not have inventory units - def require_inventory - return false unless line_items.count > 0 # This line altered - - order.completed? && !order.canceled? - end end end diff --git a/spec/models/spree/shipment_spec.rb b/spec/models/spree/shipment_spec.rb index 0c71a3ea58..66561b32a9 100644 --- a/spec/models/spree/shipment_spec.rb +++ b/spec/models/spree/shipment_spec.rb @@ -339,7 +339,7 @@ describe Spree::Shipment do context "#ship" do before do order.stub(:update!) - shipment.stub(require_inventory: false, update_order: true, state: 'ready') + shipment.stub(update_order: true, state: 'ready') shipment.stub(adjustment: charge) shipping_method.stub(:create_adjustment) shipment.stub(:ensure_correct_adjustment)