1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

Merge pull request #369 from aew/master

Fix total_count to work for Rails 4 (Ruby 2)
This commit is contained in:
Akira Matsuda 2013-06-18 05:10:33 -07:00
commit 69e44c6f15

View file

@ -18,7 +18,7 @@ module Kaminari
# .group returns an OrderdHash that responds to #count
c = c.count(column_name, options)
if c.is_a?(ActiveSupport::OrderedHash)
if c.is_a?(Hash) || c.is_a?(ActiveSupport::OrderedHash)
c.count
else
c.respond_to?(:count) ? c.count(column_name, options) : c