From 80acf795fcd5db09214f3447ca6cc234159ffd10 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Wed, 26 Feb 2025 16:45:06 +0100 Subject: [PATCH 1/2] Better Spree::UserAddress scope deprecation warnings Without the class and scope name it is very hard to find the offending code. (cherry picked from commit 7b701a142150a4587f6a355ea0df61bc2890f87d) --- core/app/models/spree/user_address.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/app/models/spree/user_address.rb b/core/app/models/spree/user_address.rb index 57dc12ea3e8..41ca17ce8b3 100644 --- a/core/app/models/spree/user_address.rb +++ b/core/app/models/spree/user_address.rb @@ -15,13 +15,13 @@ class UserAddress < Spree::Base end scope :all_historical, -> { - Spree::Deprecation.warn("This scope does not do anything and will be removed from Solidus 5.") + Spree.deprecator.warn("The 'Spree::UserAddress.all_historical` scope does not do anything and will be removed from Solidus 5.") all } scope :default_shipping, -> { where(default: true) } scope :default_billing, -> { where(default_billing: true) } scope :active, -> { - Spree::Deprecation.warn("This scope does not do anything and will be removed from Solidus 5.") + Spree.deprecator.warn("The 'Spree::UserAddress.active` scope does not do anything and will be removed from Solidus 5.") all } From 7115685e37c1b062412a0a6e44565ff70d2dce8c Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Wed, 26 Feb 2025 17:01:24 +0100 Subject: [PATCH 2/2] Fix rubocop offenses (cherry picked from commit 12b4db2ca3af69d68a43548cbc7e36c649fccd6b) --- legacy_promotions/app/models/spree/promotion.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/legacy_promotions/app/models/spree/promotion.rb b/legacy_promotions/app/models/spree/promotion.rb index 4f1d4a17445..9ae21cca59c 100644 --- a/legacy_promotions/app/models/spree/promotion.rb +++ b/legacy_promotions/app/models/spree/promotion.rb @@ -204,11 +204,7 @@ def line_item_actionable?(order, line_item, promotion_code: nil) if eligible?(order, promotion_code:) rules = eligible_rules(order) - if rules.blank? - true - else - rules.all? { |rule| rule.actionable? line_item } - end + rules.blank? || rules.all? { |rule| rule.actionable? line_item } else false end