method

count

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.