-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
[ActionDispatch] Compare keys_to_keep in symbolized form #22767
Conversation
Not comparing them in symbolized form was causing rails#12178 to occur.
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @eileencodes (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
r? @pixeltrix |
parameterized_parts.delete_if do |bad_key, _| | ||
!keys_to_keep.include?(bad_key) | ||
(parameterized_parts.symbolize_keys.keys - keys_to_keep.map(&:to_sym)).each do |bad_key| | ||
parameterized_parts.delete(bad_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if we want to do this (I don't think we want to do this), that sounds wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this commit we are still deleting keys from parameterized_parts
, the behavior is just changed so that both hashes have symbol keys, to properly process them.
This will also need a regression test to prevent the broken behavior from returning, but it's fine to wait for @pixeltrix to weigh in on the change before adding that. |
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
This solution does not seem to solve the problem, for me. |
@dv agreed, this doesn't look like it would solve the problem in #12718 as it's to do with optimised routes which doesn't hit this section of code. Also the optimised routing code has had significant refactoring for Rails 5 so it may even have been fixed. Closing because it's not the right solution. |
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
> When there's an optional scope, `link_to resource` doesn't seem to work > properly in rails 4 The fix was taken from https://git.io/v6otV. It looks like this is still an issue, so we might want to extract this monkeypatch out in to its own file if it's still broken by the time we get to Rails 4.2. - svenfuchs/routing-filter#47 - rails/rails#12178 - rails/rails#22767
Not comparing them in symbolized form was causing #12178 to occur. Now, everything is a symbol, and this makes strange formatting errors less likely to occur.