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 3fa3b4b + 3406353 commit 19de295Copy full SHA for 19de295
lib/active_admin/mongoid/helpers/collection.rb
@@ -4,13 +4,15 @@ module Collection
4
5
alias original_collection_size collection_size
6
original_collection_size = instance_method(:collection_size)
7
+
8
def collection_size(collection=collection)
- if(not collection.empty? and collection.first.class.included_modules.include?(Mongoid::Document))
9
+ if collection.is_a?(::Mongoid::Criteria)
10
collection.count(true)
11
else
12
original_collection_size(collection)
13
end
14
15
16
17
18
0 commit comments