using :group, :having, :select etc with eager loading through :include

I'm sure I've seen this on the list before, but I can't find anything in the search.

The problem is that using :include in an ActiveRecord::Base#find aliases all the columns, making it impossible to use some of the other find parameters

What's the usual solution to this?

Gareth

Gareth Adams wrote:

I'm sure I've seen this on the list before, but I can't find anything in the search.

The problem is that using :include in an ActiveRecord::Base#find aliases all the columns, making it impossible to use some of the other find parameters

What's the usual solution to this?

You will have to forgo eager loading and either load the records of the other models in separate queries, or use the :joins and :select options to pull fields of interest in the other models into the base model.