Perhaps due to the very nice batch fetch and update changes that were introduced into core recently: http://groups.google.com/group/rubyonrails-core/br... The find :include option appears to be completely ignored now, as of the 9216 gems. This example: @lobby_channels = find(:all, :include => [:players]) Does two SQL calls: SELECT * from lobby_channels Then on the first missing player: SELECT * from players WHERE id IN (115,610,1982) The new behavior of the bulk fetch is very nice, but the :include needs to still work for the case when you know you need other models ahead of time (saves DB load). Is this a known issue? Couldn't find it browing the git commits... Thanks, Nate
on 2008-04-19 22:17
on 2008-04-20 01:12
On Apr 19, 9:17 pm, Nate Wiger <nwi...@gmail.com> wrote: @lobby_channels = find(:all, :include => [:players]) > needs to still work for the case when you know you need other models > ahead of time (saves DB load). > > Is this a known issue? Couldn't find it browing the git commits... This isn't a recent change and it is deliberate (it falls back to the old implementation if the conditions or order reference one of the :included tables. The rest of the time the bulk fetch is the new implementation of :include. Fred