-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
preload associations #547
Comments
Hi, indeed preloading isn't implemented. But it sounds like a cool (but toilful) feature. Will add it to the TODO list. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
Tt seems it's not possible to
preload
associations (didn't find it in the docs, code and github issues), but it would be highly valuable for e.g.belongs_to
associations. Example:When i do:
Product.all.map(&:company).map(&:uuid).to_a
it requests each company individually (typical N+1 issue). It would be nice to be able toProduct.preload(:company).map(&:uuid).to_a
such that the companies are loaded with a single query like usually the case when using ActiveRecord. Maybe i miss something.Thanks in advance.
The text was updated successfully, but these errors were encountered: