diff options
author | Matthew Draper <matthew@trebex.net> | 2015-05-05 06:58:12 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2015-05-05 06:58:12 +0930 |
commit | e5139f17d468a8dfe2f2d1ea45e36ed256e4b4bd (patch) | |
tree | 17b6543248fa21621f4dc36e4af484b6ad3d33a4 /activesupport/lib | |
parent | a95151bb13529bdade475ba781421b647835d493 (diff) | |
parent | 40c7f74543c36670db5302df6450f4e224b685ed (diff) | |
download | rails-e5139f17d468a8dfe2f2d1ea45e36ed256e4b4bd.tar.gz rails-e5139f17d468a8dfe2f2d1ea45e36ed256e4b4bd.tar.bz2 rails-e5139f17d468a8dfe2f2d1ea45e36ed256e4b4bd.zip |
Merge pull request #20014 from vngrs/hash_deep_dup_bug
deep_dup method, remove old key from duplicated hash
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/deep_dup.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/deep_dup.rb b/activesupport/lib/active_support/core_ext/object/deep_dup.rb index 0191d2e973..ad5b2af161 100644 --- a/activesupport/lib/active_support/core_ext/object/deep_dup.rb +++ b/activesupport/lib/active_support/core_ext/object/deep_dup.rb @@ -40,6 +40,7 @@ class Hash # dup[:a][:c] # => "c" def deep_dup each_with_object(dup) do |(key, value), hash| + hash.delete(key) hash[key.deep_dup] = value.deep_dup end end |