diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-11-15 00:24:40 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-11-15 00:24:54 -0200 |
commit | 12815e0d44faf1154bebe5703577ff56c13688bc (patch) | |
tree | 47824af307f1ecf84c549b5cb46e268faa8ffcd2 /activemodel | |
parent | 4c7e3a3087d48ffbdf1c185ab12ef259b5f8e074 (diff) | |
download | rails-12815e0d44faf1154bebe5703577ff56c13688bc.tar.gz rails-12815e0d44faf1154bebe5703577ff56c13688bc.tar.bz2 rails-12815e0d44faf1154bebe5703577ff56c13688bc.zip |
Avoid a new hash allocation
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/validations/numericality.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb index 0f131de923..5acd4477ff 100644 --- a/activemodel/lib/active_model/validations/numericality.rb +++ b/activemodel/lib/active_model/validations/numericality.rb @@ -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 |