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

Fix return type of ActiveRecord::QueryMethods#extract_associated #1823

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

bdewater
Copy link
Contributor

Motivation

See https://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-extract_associated - this returns an array and the return type unknown since it depends on the association passed in.

Implementation

Override when iterating over QUERY_METHODS to return the right thing seemed like the right place to hook into since it collects methods from the aforementioned Active Record module.

Tests

Updated tests.

@bdewater bdewater requested a review from a team as a code owner March 15, 2024 14:45
@bdewater
Copy link
Contributor Author

bdewater commented Mar 15, 2024

CI is failing on unrelated protobuf errors.

@KaanOzkan
Copy link
Contributor

KaanOzkan commented Mar 21, 2024

@bdewater can you rebase on latest main?

@KaanOzkan KaanOzkan added the enhancement New feature or request label Mar 21, 2024
@bdewater bdewater force-pushed the ar-relations-extract-associated branch from cc44def to abd9115 Compare March 22, 2024 00:58
@bdewater bdewater force-pushed the ar-relations-extract-associated branch from abd9115 to f4104b6 Compare March 22, 2024 16:15
@bdewater
Copy link
Contributor Author

@KaanOzkan CI is green now :)

@KaanOzkan KaanOzkan merged commit 265bea2 into Shopify:main Mar 25, 2024
18 checks passed
@bdewater bdewater deleted the ar-relations-extract-associated branch March 25, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants