search for: stores_count

Displaying 1 result from an estimated 1 matches for "stores_count".

2008 Feb 02
1
eager include associated count?
So I know you can eager include associated rows with the :include, but is there a way to include just the associated count? User.find(:all, :select => ''id, first_name, last_name, created_at'', :limit => 30) I want to include user.store.count in the above query. Right now, this gives me an n+1 queries because i get the count for each row. <% for user in @users %>