Class: Forgeos::Cms::Statistics

Inherits:
Object
  • Object
show all
Defined in:
lib/forgeos/cms/statistics.rb

Class Method Summary collapse

Class Method Details

.pages_most_viewed(date, limit = nil) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/forgeos/cms/statistics.rb', line 4

def self.pages_most_viewed(date, limit = nil)
  PageViewedCounter.sum(:counter, :conditions => { :date => date },
    :order => 'sum_counter DESC',
    :limit => limit,
    :group => 'element_id'
  )
end

.total_of_pages(date) ⇒ Object



11
12
13
# File 'lib/forgeos/cms/statistics.rb', line 11

def self.total_of_pages(date)
  PageViewedCounter.count(:conditions => { :date => date })
end