Method: Analytic::Period#pages

Defined in:
app/models/analytic/period.rb

#pagesArray<Array(String, String, Integer)>

Returns:

  • (Array<Array(String, String, Integer)>)


25
26
27
28
29
30
31
32
# File 'app/models/analytic/period.rb', line 25

def pages
  views
    .group(:host)
    .group(:path)
    .order(count: :desc)
    .limit(PAGES_LIMIT)
    .pluck(:host, :path, Arel.sql('COUNT(*) AS count'))
end