From 38c4e1a7681d25c4caacb46a8d579f8cc6b72590 Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Thu, 5 Dec 2024 15:43:36 +0100 Subject: [PATCH] Feat(Promotions): Use order_activatable in OrderAdjuster This duplicated the logic from SolidusPromotions::Promotion.order_activatable, and this way it reads nicer. (cherry picked from commit 3588c152bc45c604c5fb5d15e66686f29d572610) --- promotions/app/models/solidus_promotions/order_adjuster.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promotions/app/models/solidus_promotions/order_adjuster.rb b/promotions/app/models/solidus_promotions/order_adjuster.rb index 8769670be57..ea16b895166 100644 --- a/promotions/app/models/solidus_promotions/order_adjuster.rb +++ b/promotions/app/models/solidus_promotions/order_adjuster.rb @@ -13,7 +13,7 @@ def initialize(order, dry_run_promotion: nil) def call order.reset_current_discounts - return order if (!SolidusPromotions.config.recalculate_complete_orders && order.complete?) || order.shipped? + return order unless SolidusPromotions::Promotion.order_activatable?(order) discounted_order = DiscountOrder.new(order, promotions, dry_run: dry_run).call