Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is:issue is:open Hash symbolize_keys stringify_keys does not work on nested hashes #253

Open
tilo opened this issue Jan 21, 2016 · 3 comments
Labels
Milestone

Comments

@tilo
Copy link
Contributor

tilo commented Jan 21, 2016

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}

@trans
Copy link
Member

trans commented Oct 1, 2016

Should they do this? Does ActiveSupport/Rails do this?

@ioquatix
Copy link
Contributor

Nope, I don't think it should work on nested hashes. Also, {stringify/symbolize}_keys is a code smell.. vote to close this issue.

@ioquatix
Copy link
Contributor

ioquatix commented Mar 9, 2017

@tilo can you explain your use case a bit more? Did you know JSON and MsgPack have options to load with symbol keys?

@ioquatix ioquatix added this to the 4.0.0 milestone Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants