aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-10-06 12:11:38 +0100
committerJon Leighton <j@jonathanleighton.com>2010-10-06 12:11:38 +0100
commitc954d54e2f36bb53ced5e3655adc071dd233797e (patch)
treed84bf4bf51f65a1c817089c6fe37c3e9f20420d0 /activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
parentf2b41914d6be935182d37e0c0d491352ac3de043 (diff)
parentd40ca9cce241a8083756c993d6c99a79e62e050e (diff)
downloadrails-c954d54e2f36bb53ced5e3655adc071dd233797e.tar.gz
rails-c954d54e2f36bb53ced5e3655adc071dd233797e.tar.bz2
rails-c954d54e2f36bb53ced5e3655adc071dd233797e.zip
Merge branch 'master' into nested_has_many_through
Diffstat (limited to 'activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb b/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
index 7a6a0be69d..af30bfc13a 100644
--- a/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
+++ b/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
@@ -158,9 +158,9 @@ class Class # :nodoc:
if inheritable_attributes.equal?(EMPTY_INHERITABLE_ATTRIBUTES)
new_inheritable_attributes = EMPTY_INHERITABLE_ATTRIBUTES
else
- new_inheritable_attributes = inheritable_attributes.inject({}) do |memo, (key, value)|
- memo.update(key => value.duplicable? ? value.dup : value)
- end
+ new_inheritable_attributes = Hash[inheritable_attributes.map do |(key, value)|
+ [key, value.duplicable? ? value.dup : value]
+ end]
end
child.instance_variable_set('@inheritable_attributes', new_inheritable_attributes)