Skip to content

Fix array query params collapsed by Addressable::URI#query_values#1

Merged
kented merged 1 commit into
masterfrom
fix-array-query-params
May 20, 2026
Merged

Fix array query params collapsed by Addressable::URI#query_values#1
kented merged 1 commit into
masterfrom
fix-array-query-params

Conversation

@kented
Copy link
Copy Markdown
Owner

@kented kented commented May 19, 2026

Summary

  • Addressable::URI#query_values returns a Hash, which deduplicates keys with the same name — array params like tedx_event_ted_user_ids[] lose all but the last value before being passed to Faraday
  • Fix: use query_values(Array) which returns an array of [key, value] pairs, preserving all values
  • This caused has_many associations resolved via link URLs with array params to silently return only one record instead of all matching records

Test plan

  • Verify has_many associations with array params in the link URL return all records
  • Confirm existing tests pass

🤖 Generated with Claude Code

@kented kented self-assigned this May 19, 2026
@kented kented force-pushed the fix-array-query-params branch 3 times, most recently from e65e2c7 to 63db3ab Compare May 19, 2026 23:35
query_values returns a Hash which deduplicates keys, so URLs with array
params like tedx_event_ted_user_ids[] lose all but the last value.
Build query_params as an array of pairs using query_values(Array) so
Faraday preserves all values for duplicate keys.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kented kented force-pushed the fix-array-query-params branch from 63db3ab to dd7a1e8 Compare May 20, 2026 00:22
@kented kented merged commit 4b1e048 into master May 20, 2026
@kented kented mentioned this pull request May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant