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

Xeroizer::Record::Base#to_h converts nil values into empty hashes #429

Open
drewish opened this issue May 11, 2018 · 0 comments
Open

Xeroizer::Record::Base#to_h converts nil values into empty hashes #429

drewish opened this issue May 11, 2018 · 0 comments
Labels

Comments

@drewish
Copy link
Contributor

drewish commented May 11, 2018

I'd been trying use to_h to get hashes that I could use slice on but ran into a kind of odd issue where values that were nil on the Xero object turned into {} in the hash. Turns out:

irb(main):001:0> nil.to_h
=> {}

So it seems buggy that we're not handling nil values separately in the to_h:

[k, v.kind_of?(Array) ? v.map(&:to_h) : (v.respond_to?(:to_h) ? v.to_h : v)]

@CloCkWeRX CloCkWeRX added the bug label Nov 11, 2018
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