ActiveRecord find :include appears broken in 9216 gems

Perhaps due to the very nice batch fetch and update changes that were introduced into core recently:

http://groups.google.com/group/rubyonrails-core/browse_thread/thread/10d20373e99a0473

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

@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...

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