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

Add Preloader::Association::LoaderQuery #41597

Merged
merged 2 commits into from Mar 16, 2021

Conversation

jhawthorn
Copy link
Member

Follow up to #41385

This class represents the query a Preloader::Association uses to load its records. This replaces the previous concept of a grouping_key and serves both to group Preloader::Associations by their query and to run the query to load the records (which nicely avoids using .first).

This should not change any functionality but should be slightly faster due to being able to avoid calling scope.to_sql unless necessary.

cc @dinahshi @eileencodes @HParker

@jhawthorn jhawthorn force-pushed the preloader_batch_loader_query branch from 761c038 to 4ef978c Compare March 5, 2021 00:00
@jhawthorn jhawthorn force-pushed the preloader_batch_loader_query branch from 4ef978c to bd17401 Compare March 12, 2021 22:43
jhawthorn and others added 2 commits March 15, 2021 17:54
Co-authored-by: Ryuta Kamizono <kamipo@gmail.com>
This class represents the query a Preloader::Association uses to load
its records. This replaces the previous concept of a grouping_key and
serves both to group Preloader::Associations by their query and to run
the query to load the records (which nicely avoids using .first).

This should not change any functionality but should be slightly faster
due to being able to avoid calling `scope.to_sql` unless necessary.
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.

None yet

2 participants