Is there a reason for firing 3 queries to count items in a collection?
The previous version caused 3 queries:
With this approach mongoid will fire only one count query
The previous version caused 3 query:
1. collection.empty? => load an item to ensure there are items in the collection
2. collection.first ... => again load an item to be sure about we querying mongo
3. collection.count(true) => actual count command