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

Ensure that Hashie::Arrays are not deconverted #505

Merged
merged 1 commit into from Dec 14, 2019

Conversation

michaelherold
Copy link
Member

In order for #dig to work properly, we need Arrays to be
Hashie::Arrays to be aware of the key conversion. Our original
Mash#convert_value method was deconverting Hashie::Arrays into
normal Arrays and causing #dig to behave in an unexpected manner.

Fixes #504

@michaelherold michaelherold self-assigned this Dec 13, 2019
In order for `#dig` to work properly, we need Arrays to be
`Hashie::Array`s to be aware of the key conversion. Our original
`Mash#convert_value` method was deconverting `Hashie::Array`s into
normal Arrays and causing `#dig` to behave in an unexpected manner.
@dblock
Copy link
Member

dblock commented Dec 14, 2019

Is there a similar problem with Hash?

@dblock dblock merged commit b0161f5 into hashie:master Dec 14, 2019
@michaelherold
Copy link
Member Author

Is there a similar problem with Hash?

Not to my knowledge since they are converted to Mashes.

@michaelherold michaelherold deleted the fix-multiple-array-conversion branch December 20, 2019 03:22
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Jan 22, 2021
https://build.opensuse.org/request/show/865196
by user coolo + dimstar_suse
- updated to version 4.1.0
 see installed CHANGELOG.md
  ## [4.1.0] - 2020-02-01

  [4.1.0]: hashie/hashie@v4.0.0...v4.1.0

  ### Added

  * [#499](hashie/hashie#499): Add `Hashie::Extensions::Mash::PermissiveRespondTo` to make specific subclasses of Mash fully respond to messages for use with `SimpleDelegator` - [@michaelherold](https://github.com/michaelherold).

  ### Fixed

  * [#467](hashie/hashie#467): Fixed `DeepMerge#deep_merge` mutating nested values within the receiver - [@michaelherold](https://github.com/michaelherold).
  * [#505](hashie/hashie#505): Ensure that `Hashie::Array`s are not deconverted within `Hashie::Mash`es to make `Mash#dig` work properly - [@Michaelhero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hashie::Array converted to Array and breaking #dig
2 participants