Count Records by Type with ActiveRecord
Account.select(:account_type).group(:account_type).count
#=> {"Employee"=>35, "Manager"=>41, "SuperAdmin"=>1, "Admin"=>8}
Tweet
Account.select(:account_type).group(:account_type).count
#=> {"Employee"=>35, "Manager"=>41, "SuperAdmin"=>1, "Admin"=>8}
Tweet