aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/ordered_hash.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-06-13 05:06:07 +0200
committerXavier Noria <fxn@hashref.com>2010-06-13 05:09:31 +0200
commit72f9fec607c4a72b2e88995d0cb32b16b96e9068 (patch)
tree6db9d499f1dd2251b17e04e9549d2c996e0d6cf8 /activesupport/lib/active_support/ordered_hash.rb
parent9183eaebed19f75980926fad2f3655f5f5e7826c (diff)
downloadrails-72f9fec607c4a72b2e88995d0cb32b16b96e9068.tar.gz
rails-72f9fec607c4a72b2e88995d0cb32b16b96e9068.tar.bz2
rails-72f9fec607c4a72b2e88995d0cb32b16b96e9068.zip
hash merging with a block ignores non-existing keys altogether
Diffstat (limited to 'activesupport/lib/active_support/ordered_hash.rb')
-rw-r--r--activesupport/lib/active_support/ordered_hash.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb
index eda33f827e..b721e6f70a 100644
--- a/activesupport/lib/active_support/ordered_hash.rb
+++ b/activesupport/lib/active_support/ordered_hash.rb
@@ -131,7 +131,7 @@ module ActiveSupport
def merge!(other_hash)
if block_given?
- other_hash.each {|k,v| self[k] = yield(k, self[k], v) }
+ other_hash.each {|k,v| self[k] = yield(k, self[k], v) if key? k}
else
other_hash.each {|k,v| self[k] = v }
end