diff --git a/core/app/models/spree/order_shipping.rb b/core/app/models/spree/order_shipping.rb index e70ccd2b3bc..bfab5ecb910 100644 --- a/core/app/models/spree/order_shipping.rb +++ b/core/app/models/spree/order_shipping.rb @@ -44,7 +44,6 @@ def ship_shipment(shipment, external_number: nil, tracking_number: nil, suppress # @return The carton created. def ship(inventory_units:, stock_location:, address:, shipping_method:, shipped_at: Time.current, external_number: nil, tracking_number: nil, suppress_mailer: false) - carton = nil Spree::InventoryUnit.transaction do diff --git a/core/lib/spree/testing_support/extension_rake.rb b/core/lib/spree/testing_support/extension_rake.rb index f03d87ce527..4597fa4465a 100644 --- a/core/lib/spree/testing_support/extension_rake.rb +++ b/core/lib/spree/testing_support/extension_rake.rb @@ -4,8 +4,8 @@ desc "Generates a dummy app for testing an extension" namespace :extension do - task :test_app, [:user_class] do |_t, _args| + task :test_app, [:user_class] do |_t, args| Spree::DummyGeneratorHelper.inject_extension_requirements = true - Rake::Task['common:test_app'].invoke + Rake::Task['common:test_app'].invoke(args[:user_class]) end end diff --git a/legacy_promotions/app/decorators/solidus_legacy_promotions/models/spree_promotion_code_batch_decorator.rb b/legacy_promotions/app/decorators/solidus_legacy_promotions/models/spree_promotion_code_batch_decorator.rb deleted file mode 100644 index fdb8c85454b..00000000000 --- a/legacy_promotions/app/decorators/solidus_legacy_promotions/models/spree_promotion_code_batch_decorator.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module SolidusLegacyPromotions - module SpreePromotionCodeBatchDecorator - def process - if state == "pending" - update!(state: "processing") - Spree::PromotionCodeBatchJob.perform_later(self) - else - raise Spree::PromotionCodeBatch::CantProcessStartedBatch.new("Batch #{id} already started") - end - end - - Spree::PromotionCodeBatch.prepend(self) - end -end diff --git a/legacy_promotions/app/models/spree/promotion_code_batch.rb b/legacy_promotions/app/models/spree/promotion_code_batch.rb index 66cbcc50d6a..85a17be14be 100644 --- a/legacy_promotions/app/models/spree/promotion_code_batch.rb +++ b/legacy_promotions/app/models/spree/promotion_code_batch.rb @@ -14,5 +14,14 @@ class CantProcessStartedBatch < StandardError def finished? state == "completed" end + + def process + if state == "pending" + update!(state: "processing") + PromotionCodeBatchJob.perform_later(self) + else + raise CantProcessStartedBatch.new("Batch #{id} already started") + end + end end end