aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorErol Fornoles <erol.fornoles@gmail.com>2017-02-20 18:52:58 +0800
committerErol Fornoles <erol.fornoles@gmail.com>2017-03-06 15:32:01 +0800
commit7b633857ddcdb129d5b78f5d9e41994018115ed9 (patch)
treec9abbead4b4837251cdf5e3f91b03a800acd45cc /activesupport/lib/active_support
parentd731d6366ae68c790ef79ff66b2d2d41f5767cc3 (diff)
downloadrails-7b633857ddcdb129d5b78f5d9e41994018115ed9.tar.gz
rails-7b633857ddcdb129d5b78f5d9e41994018115ed9.tar.bz2
rails-7b633857ddcdb129d5b78f5d9e41994018115ed9.zip
Make the order of Hash#reverse_merge! consistent with HashWithIndifferentAccess
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/reverse_merge.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
index efb9d1b8a0..bfae57d4be 100644
--- a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
+++ b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
@@ -15,8 +15,7 @@ class Hash
# Destructive +reverse_merge+.
def reverse_merge!(other_hash)
- # right wins if there is no left
- merge!(other_hash) { |key, left, right| left }
+ replace(reverse_merge(other_hash))
end
alias_method :reverse_update, :reverse_merge!
end