def count_activities(options = { })
      # default options
      options = {
        :before   => nil,
        :after    => nil,
        :entities => { },
        :only     => [ ],
        :except   => [ ],
      }.merge(options)

      options[:only] = [ options[:only] ] if (options[:only] && !options[:only].is_a?(Array))

      # count
      self.driver.count_activities(options)
    end
def count_activities(options = { })
      # default options
      options = {
        :before   => nil,
        :after    => nil,
        :entities => { },
        :only     => [ ],
        :except   => [ ],
      }.merge(options)

      options[:only] = [ options[:only] ] if (options[:only] && !options[:only].is_a?(Array))

      # count
      self.driver.count_activities(options)
    end
Count number of activities

 @note If you use one of options selectors then you have to setup corresponding indexes in database.

 @param options [Hash] Options hash
 @option options [Time]              :before   Find activities generated before that datetime (excluding)
 @option options [Time]              :after    Find activities generated after that datetime (excluding)
 @option options [Hash{Sym=>String}] :entities Filter by entities values (empty means 'all values')
 @option options [Array<Class>]      :only     Find only these activities
 @option options [Array<Class>]      :except   Skip these activities
 @return [Integer] Number of activities