summaryrefslogtreecommitdiff
path: root/lib/hashie/mash.rb
diff options
context:
space:
mode:
authorAmy Sutedja <asutedja@biaprotect.com>2014-09-04 16:31:48 -0700
committerAmy Sutedja <asutedja@biaprotect.com>2014-09-05 14:06:11 -0700
commitcebfebb8012520c4ab89d4c368983c28bdfcbe9b (patch)
tree1de0dd7e4d3d092a852477166f1ae727f617b61c /lib/hashie/mash.rb
parentcdf6c832c067112ef95fbe0dd0c5b65cf9101eae (diff)
downloadhashie-cebfebb8012520c4ab89d4c368983c28bdfcbe9b.tar.gz
Merging Hashie::Mash now correctly only calls the block on duplicate values
Diffstat (limited to 'lib/hashie/mash.rb')
-rw-r--r--lib/hashie/mash.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hashie/mash.rb b/lib/hashie/mash.rb
index b7ad40b..6d30a94 100644
--- a/lib/hashie/mash.rb
+++ b/lib/hashie/mash.rb
@@ -181,7 +181,7 @@ module Hashie
custom_reader(key).deep_update(v, &blk)
else
value = convert_value(v, true)
- value = convert_value(blk.call(key, self[k], value), true) if blk
+ value = convert_value(blk.call(key, self[k], value), true) if blk && self.key?(k)
custom_writer(key, value, false)
end
end