We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e6ca97 commit d264fa9Copy full SHA for d264fa9
core/app/models/spree/payment.rb
@@ -83,7 +83,7 @@ def amount=(amount)
83
when String
84
separator = I18n.t('number.currency.format.separator')
85
number = amount.delete("^0-9-#{separator}\.").tr(separator, '.')
86
- number.to_d if number.present?
+ number.presence&.to_d
87
end || amount
88
end
89
legacy_promotions/app/models/spree/promotion_handler/cart.rb
@@ -61,7 +61,7 @@ def sale_promotions
61
62
def promotion_code(promotion)
63
order_promotion = order.order_promotions.detect { |op| op.promotion_id == promotion.id }
64
- order_promotion.present? ? order_promotion.promotion_code : nil
+ order_promotion.presence&.promotion_code
65
66
67
def promotion_includes
0 commit comments