Why can't I eager load nested association from my controller?


0 votes
asked Mar 12, 2016 by marashi (300 points)
I'm trying to eager load nested association.

4 Answers

0 votes
answered May 6, 2016 by tviAre (230 points)

Options All of the association macros can be specialized through options.
Eager loading is supported with polymorphic associations.
To include a deep hierarchy of associations, use a hash: Post.
commented May 8, 2016 by sallach_Hu (1,260 points)
What part of the spec says that this should be the case
0 votes
answered May 20, 2016 by Tell_The (170 points)
You may want to take this to ActiveRecord::Associations::ClassMethods - APIdock for some real expert opinions
I will try to update this answer when I find out more about the missing points
commented May 20, 2016 by Pbz_So (2,160 points)
May be answer would depend on what problem you have with using iterator
commented May 22, 2016 by Vergari (120 points)
See the man page here
0 votes
answered May 30, 2016 by AlsoPadlo (140 points)
Take a look at 3 ways to do eager loading (preloading) in Rails 3 & 4 ... for a full example
Here is a really good table comparing the capabilities of each
commented May 31, 2016 by Negative_A (990 points)
Following options were elaborated starting from this answer. It should be obvious from there what went wrong
0 votes
answered May 30, 2016 by dayna (240 points)
More details about :autosave option is available atAutosaveAssociation

What is Geekub?

Q&A site for professional and enthusiast programmers, software developers and other technical users. With your help, we hope to work together to build a library of detailed answers to just about any question that is related to programming!







...