mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-28 21:07:16 +00:00
Update deprecated errors.set syntax
DEPRECATION WARNING: ActiveModel::Errors#set is deprecated and will be removed in Rails 5.1. Use model.errors.add(:preferred_discount_amount, ["has an invalid format. Please enter a number."]) instead. (called from block (2 levels) in localize_number at /home/runner/work/openfoodnetwork/openfoodnetwork/lib/spree/localized_number.rb:38)
This commit is contained in:
@@ -35,7 +35,7 @@ module Spree
|
||||
return unless Spree::Config.enable_localized_number?
|
||||
|
||||
@invalid_localized_number.andand.each do |error_attribute|
|
||||
errors.set(error_attribute, [I18n.t('spree.localized_number.invalid_format')])
|
||||
errors.add(error_attribute, I18n.t('spree.localized_number.invalid_format'))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user