Permalink
Browse files

Avoid a new hash allocation

  • Loading branch information...
1 parent 4c7e3a3 commit 12815e0d44faf1154bebe5703577ff56c13688bc @carlosantoniodasilva carlosantoniodasilva committed Nov 15, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activemodel/lib/active_model/validations/numericality.rb
@@ -48,7 +48,7 @@ def validate_each(record, attr_name, value)
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

0 comments on commit 12815e0

Please sign in to comment.