Skip to content

Commit

Permalink
Made kaminari work better with polymorphic eager loading in rails 3.
Browse files Browse the repository at this point in the history
Conflicts:

	lib/kaminari/models/active_record_relation_methods.rb
  • Loading branch information
amatsuda committed Apr 19, 2011
1 parent e4ec3ad commit b68068b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kaminari/models/active_record_relation_methods.rb
Expand Up @@ -10,7 +10,7 @@ def count #:nodoc:

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
Expand Down

0 comments on commit b68068b

Please sign in to comment.