Skip to content

Commit 4982ba9

Browse files
committed
Fix represneted attribtues' errors moving
1 parent 3579daa commit 4982ba9

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/active_data/model/representation.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ def emerge_represented_attributes_errors!
7474

7575
if ActiveModel.version >= Gem::Version.new('6.1.0')
7676
def move_errors(from, to)
77-
errors.each do |error|
78-
next unless error.attribute == from
79-
77+
errors.where(from).each do |error|
8078
errors.add(to, error.type, message: error.message)
8179
errors.delete(error.attribute, error.type)
8280
end

0 commit comments

Comments
 (0)