From b68068bd5ad050b5bbbc2c1e7ee155b5ec55946a Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Tue, 19 Apr 2011 19:02:01 +0900 Subject: [PATCH] Made kaminari work better with polymorphic eager loading in rails 3. Conflicts: lib/kaminari/models/active_record_relation_methods.rb --- lib/kaminari/models/active_record_relation_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kaminari/models/active_record_relation_methods.rb b/lib/kaminari/models/active_record_relation_methods.rb index 7bdee79..bd805f4 100644 --- a/lib/kaminari/models/active_record_relation_methods.rb +++ b/lib/kaminari/models/active_record_relation_methods.rb @@ -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