From ecbdec115bc87636f975b962bff7a9ac89a145fa Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 23 Aug 2010 17:26:20 -0700 Subject: making variable names a little more clear --- activesupport/lib/active_support/core_ext/hash/reverse_merge.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 d7ebd5feef..a82cdfc360 100644 --- a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +++ b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb @@ -21,7 +21,8 @@ class Hash # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second. # Modifies the receiver in place. def reverse_merge!(other_hash) - merge!( other_hash ){|k,o,n| o } + # right wins if there is no left + merge!( other_hash ){|key,left,right| left } end alias_method :reverse_update, :reverse_merge! -- cgit v1.2.3