We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0fb5a35 + 47cae71 commit 99999afCopy full SHA for 99999af
lib/active_admin/mongoid/helpers/collection.rb
@@ -1,8 +1,15 @@
1
module ActiveAdmin
2
module Helpers
3
module Collection
4
+
5
+ alias original_collection_size collection_size
6
+ original_collection_size = instance_method(:collection_size)
7
def collection_size(collection=collection)
- collection.count(true)
8
+ if(not collection.empty? and collection.first.class.included_modules.include?(Mongoid::Document))
9
+ collection.count(true)
10
+ else
11
+ original_collection_size(collection)
12
+ end
13
end
14
15
0 commit comments