From 7b633857ddcdb129d5b78f5d9e41994018115ed9 Mon Sep 17 00:00:00 2001 From: Erol Fornoles Date: Mon, 20 Feb 2017 18:52:58 +0800 Subject: Make the order of Hash#reverse_merge! consistent with HashWithIndifferentAccess --- activesupport/lib/active_support/core_ext/hash/reverse_merge.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activesupport/lib') 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 -- cgit v1.2.3