Closed alexgb closed 11 years ago
The intention for #count
is that it apply to the collection as it is at that point in time. For example, these two should always be equivalent:
collection.count == collection.to_a.count
The fact that the COUNT(*) is applied to the query directly, and not using the query as a subquery, is the reason for the behaviour being broken at the moment.
This helps when doing paging like so...
Also, in this regard, my preference is for limit to be ignored from count aggregations and have added a spec to indicate so.