Limit Eager Loading?


#1

Is there a way to limit eager loading? I want to feature categories,
each with three Items from that category. Is there anyway to do that
with eager loading or would you recommend a different method?

Thanks!

-Mario


#2

On 9 Mar 2009, at 17:48, Mario F. wrote:

Is there a way to limit eager loading? I want to feature categories,
each with three Items from that category. Is there anyway to do that
with eager loading or would you recommend a different method?

Not unless you can express that limit as an sql condition.
fundamentally eager loading can’t do limits on the number of child
records retrieved (at least not without doing it the dumb way ie
loading all associated records and then using ruby to throw away the
extra ones).

Fred