amatsuda/kaminari — pull request #216 by ejdyksen (2012-03-07 10:06:44+00:00)
Title: Support for grouped values coming from count

Calling count on a relation is not guaranteed to return an integer. It can return an OrderedHash if the relation is using a group clause.

> Grouped values: This returns an ordered hash of the values and groups them by the :group option.

[Source](http://ar.rubyonrails.org/classes/ActiveRecord/Calculations/ClassMethods.html#M000297)

This fix checks to see if that is the case and returns the length of that hash instead of the hash itself.