aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-08 13:55:30 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-08 13:55:30 -0700
commitc0c8a04efc16d3737b3a153b1ee4f75065c3193a (patch)
tree02ce59279f011ab03f7ac91a09a28772a73ac60c /activerecord/lib/active_record/base.rb
parenta5d894ce566a21ec4c5db9df06be7f22a1690691 (diff)
downloadrails-c0c8a04efc16d3737b3a153b1ee4f75065c3193a.tar.gz
rails-c0c8a04efc16d3737b3a153b1ee4f75065c3193a.tar.bz2
rails-c0c8a04efc16d3737b3a153b1ee4f75065c3193a.zip
avoid an inject in favor of dup
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb6
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 ])