Skip to content

Commit

Permalink
MongoidCriteriaMethods#total_count uses :size instead of :count
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhomart committed Aug 14, 2014
1 parent 5b221e0 commit fb58fb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/kaminari/models/mongoid_criteria_methods.rb
Expand Up @@ -19,12 +19,12 @@ def offset_value #:nodoc:

def total_count #:nodoc:
@total_count ||= if embedded?
unpage.count
unpage.size
else
if options[:max_scan] && options[:max_scan] < count
if options[:max_scan] && options[:max_scan] < size
options[:max_scan]
else
count
size
end
end
end
Expand Down

0 comments on commit fb58fb2

Please sign in to comment.