Presently it is possible to count all the records of a query set by relying on the #count method:
# Number of published articles:
Article.filter(published: true).count
It would be interesting to provide the ability to specify a field name to this method in order to count the number of records for which the specified field has a value in the database:
# Number of articles whose subtitle is present:
Article.filter(published: true).count(:subtitle)
Description
Presently it is possible to count all the records of a query set by relying on the
#count
method:It would be interesting to provide the ability to specify a field name to this method in order to count the number of records for which the specified field has a value in the database: