Forum: Ruby on Rails Limited eager loads and conditions on the eager tables

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Mark B. (Guest)
on 2006-01-19 05:07
(Received via mailing list)

Why are limited eager loads and conditions on the eager tables

Doing a find(:all) without :include causes a select * query to be
which means the id fields everwrite each other if associated tables are
included using :joins.

But using :include, if conditions are placed on the tables listed in
then Rails throws an exception when :limit is included too.

Ordinarily I'd just leave out the limit, but I'm populating a div of
size with draggables so I can't have overflow set to auto, or they can't
dragged out of the div...

Anyone have any suggestions as to how to use conditions on joined tables
limits as well? I'm thinking I might have to use :joins with :select and
the columns specifically, but it makes for messy code.

This topic is locked and can not be replied to.