From 982b0583fa09a2fc33308e3b54fb2037bf7dad32 Mon Sep 17 00:00:00 2001 From: Edward Wible Date: Mon, 18 Mar 2013 14:12:20 -0400 Subject: [PATCH] check for Hash in addition to OrderedHash, which seems to break in Rails 4, for total_count --- 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 736836b..378a42d 100644 --- a/lib/kaminari/models/active_record_relation_methods.rb +++ b/lib/kaminari/models/active_record_relation_methods.rb @@ -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