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

Hashie::Mash#load no longer accepts Pathname #398

Closed
albb0920 opened this issue Feb 6, 2017 · 2 comments
Closed

Hashie::Mash#load no longer accepts Pathname #398

albb0920 opened this issue Feb 6, 2017 · 2 comments
Labels

Comments

@albb0920
Copy link

albb0920 commented Feb 6, 2017

Hi

I find passing Pathname to Hashie::Mash.load() has been broken since 3.5.1 (works fine in 3.4.6)

hashie-3.5.1/lib/hashie/mash.rb:114:in `custom_writer': undefined method `to_sym' for #<Pathname:test.yml> (NoMethodError)
Did you mean?  to_s
	from /home/albb0920/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/hashie-3.5.1/lib/hashie/mash.rb:73:in `load'

I believe this is introduced in this commit, as it assumes key respond to #to_sym without using convert_key()
e35e628#diff-167a475bc5a73269819928a9da362073R112

changing this line to "key_as_symbol = convert_key(key).to_sym" will fix it.

Should I submit a pull request?
Thank you

@dblock
Copy link
Member

dblock commented Feb 6, 2017

Yes, please.

@dblock
Copy link
Member

dblock commented Feb 10, 2017

Fixed in #399.

@dblock dblock closed this as completed Feb 10, 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

2 participants