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

[ActionDispatch] Compare keys_to_keep in symbolized form #22767

Closed
wants to merge 1 commit into from

Conversation

maclover7
Copy link
Contributor

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.

Not comparing them in symbolized form was causing rails#12178 to occur.
@rails-bot
Copy link

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.

@rafaelfranca
Copy link
Member

r? @pixeltrix

@rails-bot rails-bot assigned pixeltrix and unassigned eileencodes Dec 23, 2015
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)
Copy link
Member

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.

Copy link
Contributor Author

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.

@eileencodes
Copy link
Member

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.

mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Aug 17, 2016
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Aug 26, 2016
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Sep 5, 2016
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Sep 6, 2016
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Sep 15, 2016
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Sep 15, 2016
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Oct 3, 2016
> 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
crowbot pushed a commit to mysociety/alaveteli that referenced this pull request Oct 25, 2016
> 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
@dv
Copy link
Contributor

dv commented Nov 21, 2016

This solution does not seem to solve the problem, for me.

@pixeltrix
Copy link
Contributor

@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.

@pixeltrix pixeltrix closed this Nov 21, 2016
@maclover7 maclover7 deleted the fix-12178 branch November 21, 2016 20:13
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Nov 24, 2016
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Feb 16, 2017
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Feb 16, 2017
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Feb 22, 2017
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Feb 23, 2017
> 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
lizconlan pushed a commit to mysociety/alaveteli that referenced this pull request Feb 28, 2017
> 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
lizconlan pushed a commit to mysociety/alaveteli that referenced this pull request Feb 28, 2017
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Feb 28, 2017
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Feb 28, 2017
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Mar 1, 2017
> 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
mysociety-pusher pushed a commit to mysociety/alaveteli that referenced this pull request Mar 16, 2017
> 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
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.

7 participants