Class: AhoyCaptain::Stats::UniqueVisitorsController

Inherits:
BaseController show all
Defined in:
app/controllers/ahoy_captain/stats/unique_visitors_controller.rb

Constant Summary

Constants inherited from BaseController

BaseController::INTERVALS, BaseController::INTERVAL_PERIOD

Instance Method Summary collapse

Methods inherited from ApplicationController

#period

Methods included from Rangeable

#period

Methods included from CompareMode

#compare_mode?, #comparison_mode, included

Instance Method Details

#indexObject



4
5
6
7
8
# File 'app/controllers/ahoy_captain/stats/unique_visitors_controller.rb', line 4

def index
  @stats = AhoyCaptain::Stats::UniqueVisitorsQuery.call(params).with_lazy_comparison(compare_mode?).group_by_period(selected_interval, :started_at).count
  @stats = lazy_window(@stats)
  @label = "Visitors"
end