diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-11-03 01:56:16 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-11-03 01:56:16 +0530 |
commit | 3b0bb08699ce409b8213c82956dc34086dcbc8b9 (patch) | |
tree | 34398e3421fcfd86aab2b5fc757175dd2ce7664d /activesupport/lib/active_support/core_ext/hash/deep_merge.rb | |
parent | 974467d70d337d4c60414c792e275d367143217b (diff) | |
parent | ee917493e451e552fef18367f8bcba2f36080685 (diff) | |
download | rails-3b0bb08699ce409b8213c82956dc34086dcbc8b9.tar.gz rails-3b0bb08699ce409b8213c82956dc34086dcbc8b9.tar.bz2 rails-3b0bb08699ce409b8213c82956dc34086dcbc8b9.zip |
Merge branch 'master' of github.com:lifo/docrails
Conflicts:
actionpack/lib/action_controller/metal/mime_responds.rb
activerecord/lib/active_record/attribute_methods.rb
guides/source/working_with_javascript_in_rails.md
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash/deep_merge.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/deep_merge.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/deep_merge.rb b/activesupport/lib/active_support/core_ext/hash/deep_merge.rb index 83f0c87b04..e07db50b77 100644 --- a/activesupport/lib/active_support/core_ext/hash/deep_merge.rb +++ b/activesupport/lib/active_support/core_ext/hash/deep_merge.rb @@ -4,10 +4,10 @@ class Hash # h1 = { x: { y: [4,5,6] }, z: [7,8,9] } # h2 = { x: { y: [7,8,9] }, z: 'xyz' } # - # h1.deep_merge(h2) #=> {:x => {:y => [7, 8, 9]}, :z => "xyz"} - # h2.deep_merge(h1) #=> {:x => {:y => [4, 5, 6]}, :z => [7, 8, 9]} + # h1.deep_merge(h2) #=> {x: {y: [7, 8, 9]}, z: "xyz"} + # h2.deep_merge(h1) #=> {x: {y: [4, 5, 6]}, z: [7, 8, 9]} # h1.deep_merge(h2) { |key, old, new| Array.wrap(old) + Array.wrap(new) } - # #=> {:x => {:y => [4, 5, 6, 7, 8, 9]}, :z => [7, 8, 9, "xyz"]} + # #=> {:x=>{:y=>[4, 5, 6, 7, 8, 9]}, :z=>[7, 8, 9, "xyz"]} def deep_merge(other_hash, &block) dup.deep_merge!(other_hash, &block) end |