diff options
author | Larry Sprock <larry@lucidbleu.com> | 2010-11-14 15:01:14 +0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-11-14 17:14:47 +0800 |
commit | f43e5d160bf9708ad50b58c8168e38579769e024 (patch) | |
tree | 6e62b75009fd7b8fc4eb6541005c7ce7cab2df10 /activesupport/lib/active_support/hash_with_indifferent_access.rb | |
parent | 293c8a4de5bfe3274e0fda7dfab1b6ec296bb829 (diff) | |
download | rails-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.rb | 2 |
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 |