diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-11-15 00:05:10 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-11-15 00:07:22 -0200 |
commit | f70e30ec6d3655d4a29de8014dfc501dab4008ae (patch) | |
tree | 0a8f9b00bcffa0849bcf0d3de8822bd88c00d119 /activemodel/lib | |
parent | 6b84de457589335754b0cd2f26d620ce93c3de82 (diff) | |
download | rails-f70e30ec6d3655d4a29de8014dfc501dab4008ae.tar.gz rails-f70e30ec6d3655d4a29de8014dfc501dab4008ae.tar.bz2 rails-f70e30ec6d3655d4a29de8014dfc501dab4008ae.zip |
Avoid creation of extra hash with merge just to set a value
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/validations/numericality.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb index c6abe45f4a..a02dc8b9e3 100644 --- a/activemodel/lib/active_model/validations/numericality.rb +++ b/activemodel/lib/active_model/validations/numericality.rb @@ -73,7 +73,9 @@ module ActiveModel end def filtered_options(value) - options.except(*RESERVED_OPTIONS).merge!(value: value) + filtered = options.except(*RESERVED_OPTIONS) + filtered[:value] = value + filtered end end |