aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/hash_with_indifferent_access.rb
diff options
context:
space:
mode:
authorLarry Sprock <larry@lucidbleu.com>2010-11-14 15:01:14 +0800
committerJosé Valim <jose.valim@gmail.com>2010-11-14 17:14:47 +0800
commitf43e5d160bf9708ad50b58c8168e38579769e024 (patch)
tree6e62b75009fd7b8fc4eb6541005c7ce7cab2df10 /activesupport/lib/active_support/hash_with_indifferent_access.rb
parent293c8a4de5bfe3274e0fda7dfab1b6ec296bb829 (diff)
downloadrails-f43e5d160bf9708ad50b58c8168e38579769e024.tar.gz
rails-f43e5d160bf9708ad50b58c8168e38579769e024.tar.bz2
rails-f43e5d160bf9708ad50b58c8168e38579769e024.zip
HashWithIndifferentAccess should not change the subclass of an array
Diffstat (limited to 'activesupport/lib/active_support/hash_with_indifferent_access.rb')
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb
index 06dd18966e..320f5c1c92 100644
--- a/activesupport/lib/active_support/hash_with_indifferent_access.rb
+++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -144,7 +144,7 @@ module ActiveSupport
when Hash
self.class.new_from_hash_copying_default(value)
when Array
- value.collect { |e| e.is_a?(Hash) ? self.class.new_from_hash_copying_default(e) : e }
+ value.dup.replace(value.collect { |e| e.is_a?(Hash) ? self.class.new_from_hash_copying_default(e) : e })
else
value
end