method

count

rails latest stable - Class: ActiveRecord::Base

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1.0.0) is shown here.

count(conditions = nil, joins = nil)
public

Returns the number of records that meet the conditions. Zero is returned if no records match. Example:

  Product.count "sales > 1"

1Note

Moved to ActiveRecord::Calculations::ClassMethods

misaka ยท Aug 28, 20083 thanks

It appears that this method has simply been moved to the module ActiveRecord::Calculations::ClassMethods. You can still use the example listed in the docs here, it will simply call the method ActiveRecord::Calculations::ClassMethods#count.