Skip to content

Conversation

@jhawthorn
Copy link
Member

@jhawthorn jhawthorn commented Aug 21, 2024

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_s the 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)

@rails-bot rails-bot bot added the actionpack label Aug 21, 2024
Co-authored-by: Matthew Draper <matthew@trebex.net>
@gmcgibbon
Copy link
Member

gmcgibbon commented Sep 3, 2024

Thanks for reverting. I'll take a look and see what I can do about this edge case. 🙇

gmcgibbon added a commit to Shopify/rails that referenced this pull request Nov 15, 2024
…routes"

This reverts commit 888d284, reversing
changes made to d8d5554.
@gmcgibbon gmcgibbon mentioned this pull request Nov 21, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression on main for resources with a hash

2 participants