facets
facets copied to clipboard
is:issue is:open Hash symbolize_keys stringify_keys does not work on nested hashes
symbolize_keys and stringify_keys does not work on nested hashes:
> {"this"=>{"is"=>:an, "awful"=>:example}, "very"=>:weird}.symbolize_keys
=> {:this=>{"is"=>:an, "awful"=>:example}, :very=>:weird}
and: > {:this => {:is => :an , :awful => :example}, :very => :weird}.stringify_keys => {"this"=>{:is=>:an, :awful=>:example}, "very"=>:weird}
Should they do this? Does ActiveSupport/Rails do this?
Nope, I don't think it should work on nested hashes. Also, {stringify/symbolize}_keys is a code smell.. vote to close this issue.
@tilo can you explain your use case a bit more? Did you know JSON and MsgPack have options to load with symbol keys?