Resetting skip and limit when trying to get total count

This commit is contained in:
Sam Lown 2011-04-15 16:24:52 +02:00
parent 00a4cc7f3b
commit cacc320235
2 changed files with 10 additions and 2 deletions

View file

@ -113,7 +113,7 @@ module CouchRest
def count
raise "View#count cannot be used with group options" if query[:group]
if can_reduce?
row = reduce.rows.first
row = reduce.skip(0).limit(1).rows.first
row.nil? ? 0 : row.value
else
limit(0).total_rows