Made kaminari work better with polymorphic eager loading in rails 3.

Conflicts:

	lib/kaminari/models/active_record_relation_methods.rb
This commit is contained in:
Akira Matsuda 2011-04-19 19:02:01 +09:00
parent e4ec3ad450
commit b68068bd5a
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ module Kaminari
def total_count #:nodoc:
# #count overrides the #select which could include generated columns referenced in #order, so skip #order here, where it's irrelevant to the result anyway
c = except(:offset, :limit, :order).count
c = except(:offset, :limit, :includes, :order).count
# .group returns an OrderdHash that responds to #count
c.respond_to?(:count) ? c.count : c
end