summaryrefslogtreecommitdiff
path: root/lib/hashie/extensions/coercion.rb
diff options
context:
space:
mode:
authorDave Mitchell <dave@connectedbits.com>2013-07-28 17:20:38 -0400
committerDave Mitchell <dave@connectedbits.com>2013-07-28 17:20:38 -0400
commit35efddc3b2baf5253cac532cd668448ab0a81360 (patch)
tree44f10e4b62db68dbf4355f18d8af0c79e3919e49 /lib/hashie/extensions/coercion.rb
parent3321005d0bd77e0811a2cea6dbbd302d8e86851f (diff)
downloadhashie-35efddc3b2baf5253cac532cd668448ab0a81360.tar.gz
Fixes Issue #106: deep_merge recursively slow
The call to custom_writer within deep_merge was exponentially converting the values (unnecessarily, since they were just converted within deep_merge). Added an optional param to custom_writer to suppress the conversion. Unfortunately, had to also add the param to coercion's customer_writer method as well (which is just ignored) to not break the inheritance. All tests pass.
Diffstat (limited to 'lib/hashie/extensions/coercion.rb')
-rw-r--r--lib/hashie/extensions/coercion.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hashie/extensions/coercion.rb b/lib/hashie/extensions/coercion.rb
index c89f20d..9ba8288 100644
--- a/lib/hashie/extensions/coercion.rb
+++ b/lib/hashie/extensions/coercion.rb
@@ -21,7 +21,7 @@ module Hashie
super(key, value)
end
- def custom_writer(key, value)
+ def custom_writer(key, value, convert=true)
self[key] = value
end