Revert keyword argument changes to routing mapper #52664
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.
Reverts #52512 and #52605
Fixes #52663
@gmcgibbon sorry! We need to back these out. This seems to be breaking routes for a lot of folks, including GitHub, devise, others.
If we want to make a change like this we need it to go through a deprecation cycle where passing a hash continues to work but warns a user to add a keyword splat or switch to keyword args.
The way the previous code failed for people was also pretty dangerous, it would (depending on the hash) silently
to_sthe hash passed in and use that as a path component. It might also be a good idea if we reintroduce these changes to even outside of the deprecation to check for a Hash being passed in.We also need to have tests for the deprecated behaviour to ensure it works (w/
assert_deprecated). I've added a test here showing the hash-options case. I think we're also missing coverage of some of the mapper because the some of the logic being reverted also does not seem quite right #52512 (comment)