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:
Matt-Yorkley
2021-03-23 19:18:07 +00:00
parent 525fef14b1
commit 5f4e3c75c7

View File

@@ -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