1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Avoid a new hash allocation

This commit is contained in:
Carlos Antonio da Silva 2013-11-15 00:24:40 -02:00
parent 4c7e3a3087
commit 12815e0d44

View file

@ -48,7 +48,7 @@ module ActiveModel
option_value = record.send(option_value) if option_value.is_a?(Symbol)
unless value.send(CHECKS[option], option_value)
record.errors.add(attr_name, option, filtered_options(value).merge(count: option_value))
record.errors.add(attr_name, option, filtered_options(value).merge!(count: option_value))
end
end
end