Don't bother with the includes when doing the count - they aren't needed

and just make it much less efficient.
This commit is contained in:
Tom Hughes 2009-06-07 16:32:00 +00:00
parent 03dc9ec8cb
commit 6d11673562

View file

@ -175,7 +175,6 @@ module ActionController
def count_collection_for_pagination(model, options)
model.count(:conditions => options[:conditions],
:joins => options[:join] || options[:joins],
:include => options[:include],
:select => (options[:group] ? "DISTINCT #{options[:group]}" : options[:count]))
end