diff --git a/admin/lib/solidus_admin/testing_support/admin_assets.rb b/admin/lib/solidus_admin/testing_support/admin_assets.rb index b9562ea4648..84251849436 100644 --- a/admin/lib/solidus_admin/testing_support/admin_assets.rb +++ b/admin/lib/solidus_admin/testing_support/admin_assets.rb @@ -3,7 +3,9 @@ RSpec.configure do |config| config.when_first_matching_example_defined(solidus_admin: true) do config.before(:suite) do - system('bin/rails solidus_admin:tailwindcss:build') or abort 'Failed to build Tailwind CSS' + # rubocop:disable Rails/Exit + system("bin/rails solidus_admin:tailwindcss:build") or abort "Failed to build Tailwind CSS" + # rubocop:enable Rails/Exit Rails.application.precompiled_assets end end diff --git a/core/app/models/spree/payment.rb b/core/app/models/spree/payment.rb index 9f034f60ac7..1c718865649 100644 --- a/core/app/models/spree/payment.rb +++ b/core/app/models/spree/payment.rb @@ -83,7 +83,7 @@ def amount=(amount) when String separator = I18n.t('number.currency.format.separator') number = amount.delete("^0-9-#{separator}\.").tr(separator, '.') - number.to_d if number.present? + number.presence&.to_d end || amount end diff --git a/core/lib/generators/solidus/install/app_templates/authentication/existing.rb b/core/lib/generators/solidus/install/app_templates/authentication/existing.rb index 898254f35d8..41011d823f4 100644 --- a/core/lib/generators/solidus/install/app_templates/authentication/existing.rb +++ b/core/lib/generators/solidus/install/app_templates/authentication/existing.rb @@ -4,7 +4,9 @@ user_class.classify.constantize rescue NameError say_status :error, "Can't find an existing user class named #{user_class.classify}, plese set up one before using this authentication option.", :red + # rubocop:disable Rails/Exit abort + # rubocop:enable Rails/Exit end generate "spree:custom_user #{user_class.shellescape}" diff --git a/legacy_promotions/app/models/spree/promotion_handler/cart.rb b/legacy_promotions/app/models/spree/promotion_handler/cart.rb index 24360fbd82d..a64b1e82fd8 100644 --- a/legacy_promotions/app/models/spree/promotion_handler/cart.rb +++ b/legacy_promotions/app/models/spree/promotion_handler/cart.rb @@ -61,7 +61,7 @@ def sale_promotions def promotion_code(promotion) order_promotion = order.order_promotions.detect { |op| op.promotion_id == promotion.id } - order_promotion.present? ? order_promotion.promotion_code : nil + order_promotion.presence&.promotion_code end def promotion_includes