fix deprecation warning when accessing model errors

This commit is contained in:
Ana Nunes da Silva
2023-02-26 21:04:16 +00:00
parent 3ffe39d467
commit d70c34fbd0

View File

@@ -415,8 +415,8 @@ module Spree
# If the master cannot be saved, the Product object will get its errors
# and will be destroyed
rescue ActiveRecord::RecordInvalid
master.errors.each do |att, error|
errors.add(att, error)
master.errors.each do |error|
errors.add error.attribute, error.message
end
raise
end