Only flatten first level to preserve nested #48063
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Background
I just tried edge Rails to see what breaks in my app, and this was the first thing that broke 馃槄
I have a hash of hashes for which I use in_order_of, and since this change I don't get ordered array of hashes, but I get a longer array of flattened values.
The actual object:
Before:
Currently:
And it broke, because I'm using it like so:
and now of course the
info
isnil
馃槄This PR fixes it so the behavior stays the same.
Detail
This Pull Request
changesimproves the implementation of #47805.Additional information
Asked if this is intended behavior or a broken thing on Discord, and got instructed to open a PR so here we are 馃槃
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]