Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Models loaded via eager_load don't auto eager load nested associations #17

Closed
jturkel opened this issue Sep 12, 2014 · 1 comment
Closed
Assignees
Labels

Comments

@jturkel
Copy link
Member

jturkel commented Sep 12, 2014

Here's a test case:

blogs = Blog.order(:name).eager_load(:posts).to_a
blogs.first.posts.to_a.first.author

blogs.flat_map(&:posts).drop(1).each do |blog|
  expect(blog.association(:author)).to be_loaded
end
@jturkel jturkel added the bug label Sep 12, 2014
@jturkel
Copy link
Member Author

jturkel commented Sep 12, 2014

Note this is not a problem for associations loaded via includes or preload.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant