diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-08 13:55:30 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-08 13:55:30 -0700 |
commit | c0c8a04efc16d3737b3a153b1ee4f75065c3193a (patch) | |
tree | 02ce59279f011ab03f7ac91a09a28772a73ac60c | |
parent | a5d894ce566a21ec4c5db9df06be7f22a1690691 (diff) | |
download | rails-c0c8a04efc16d3737b3a153b1ee4f75065c3193a.tar.gz rails-c0c8a04efc16d3737b3a153b1ee4f75065c3193a.tar.bz2 rails-c0c8a04efc16d3737b3a153b1ee4f75065c3193a.zip |
avoid an inject in favor of dup
-rw-r--r-- | activerecord/lib/active_record/base.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index ef4834811c..b4d0da9f78 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1080,9 +1080,9 @@ module ActiveRecord #:nodoc: if method_scoping.is_a?(Hash) # Dup first and second level of hash (method and params). - method_scoping = method_scoping.inject({}) do |hash, (method, params)| - hash[method] = (params == true) ? params : params.dup - hash + method_scoping = method_scoping.dup + method_scoping.each do |method, params| + method_scoping[method] = params.dup unless params == true end method_scoping.assert_valid_keys([ :find, :create ]) |