-
Notifications
You must be signed in to change notification settings - Fork 21.9k
Fix #to_query
to not include =
for nil values
#53962
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seanpdoyle
reviewed
Dec 15, 2024
Fix: rails#28322 This is more consistent with the behavior of `Rack::Utils.parse_nested_query`. Co-Authored-By: Erol Fornoles <erol.fornoles@gmail.com>
seanpdoyle
added a commit
to seanpdoyle/activeresource
that referenced
this pull request
Jan 5, 2025
Follow-up to rails/rails#53962 As of [abdbff4][], calls to [Hash#to_query][] with `nil` values will omit the joining `=` character. This change resolves [CI failures][] for Rails past `rails@8.1` like: ``` 1) Failure: BaseTest#test_collection_path_with_parameters [test/cases/base_test.rb:779]: Expected: "/people.json?gender=" Actual: "/people.json?gender" 2) Failure: SingletonTest#test_singleton_path_with_parameters [test/singleton_test.rb:44]: Expected: "/weather.json?degrees=" Actual: "/weather.json?degrees" ``` [abdbff5]: rails/rails@abdbff5 [Hash#to_query]: https://edgeapi.rubyonrails.org/classes/Hash.html#method-i-to_query [CI failures]: https://github.com/rails/activeresource/actions/runs/12606260018/job/35136128961?pr=411#step:4:17
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix: #28322
This is more consistent with the behavior of
Rack::Utils.parse_nested_query
.