Skip to content

Commit 143f09a

Browse files
authored
Merge pull request #6372 from mamhoff/rubocop-2025-11
Fix Rubocop offenses for November 2025
2 parents ed56090 + b773daa commit 143f09a

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

admin/lib/solidus_admin/testing_support/admin_assets.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
RSpec.configure do |config|
44
config.when_first_matching_example_defined(solidus_admin: true) do
55
config.before(:suite) do
6-
system('bin/rails solidus_admin:tailwindcss:build') or abort 'Failed to build Tailwind CSS'
6+
# rubocop:disable Rails/Exit
7+
system("bin/rails solidus_admin:tailwindcss:build") or abort "Failed to build Tailwind CSS"
8+
# rubocop:enable Rails/Exit
79
Rails.application.precompiled_assets
810
end
911
end

core/app/models/spree/payment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def amount=(amount)
8383
when String
8484
separator = I18n.t('number.currency.format.separator')
8585
number = amount.delete("^0-9-#{separator}\.").tr(separator, '.')
86-
number.to_d if number.present?
86+
number.presence&.to_d
8787
end || amount
8888
end
8989

core/lib/generators/solidus/install/app_templates/authentication/existing.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
user_class.classify.constantize
55
rescue NameError
66
say_status :error, "Can't find an existing user class named #{user_class.classify}, plese set up one before using this authentication option.", :red
7+
# rubocop:disable Rails/Exit
78
abort
9+
# rubocop:enable Rails/Exit
810
end
911

1012
generate "spree:custom_user #{user_class.shellescape}"

legacy_promotions/app/models/spree/promotion_handler/cart.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def sale_promotions
6161

6262
def promotion_code(promotion)
6363
order_promotion = order.order_promotions.detect { |op| op.promotion_id == promotion.id }
64-
order_promotion.present? ? order_promotion.promotion_code : nil
64+
order_promotion.presence&.promotion_code
6565
end
6666

6767
def promotion_includes

0 commit comments

Comments
 (0)