diff options
author | Albert Song <albb@teamt5.org> | 2017-02-08 12:11:30 +0800 |
---|---|---|
committer | Albert Song <albb@teamt5.org> | 2017-02-08 12:11:30 +0800 |
commit | f6540277b39e85a759bb99e58c28449272cd4fed (patch) | |
tree | b4f913fd7a311185cdf08ef8a575599d6df017cf /lib/hashie/mash.rb | |
parent | ba5854a8df89a5e930587622a74a5b188e9a5e06 (diff) | |
download | hashie-f6540277b39e85a759bb99e58c28449272cd4fed.tar.gz |
Fix passing Pathname object to Hashie::Mesh.load()
With a test that would fail without this patch.
Diffstat (limited to 'lib/hashie/mash.rb')
-rw-r--r-- | lib/hashie/mash.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/hashie/mash.rb b/lib/hashie/mash.rb index 603b8c5..d6b0aed 100644 --- a/lib/hashie/mash.rb +++ b/lib/hashie/mash.rb @@ -134,9 +134,10 @@ module Hashie # a string before it is set, and Hashes will be converted # into Mashes for nesting purposes. def custom_writer(key, value, convert = true) #:nodoc: - key_as_symbol = key.to_sym + key_as_symbol = (key = convert_key(key)).to_sym + log_built_in_message(key_as_symbol) if methods.include?(key_as_symbol) - regular_writer(convert_key(key), convert ? convert_value(value) : value) + regular_writer(key, convert ? convert_value(value) : value) end alias_method :[], :custom_reader |