Class: AhoyCaptain::Stats::BounceRatesController

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

Constant Summary

Constants inherited from BaseController

AhoyCaptain::Stats::BaseController::INTERVALS, AhoyCaptain::Stats::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

@todo: this is lazy



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

def index
  @stats = AhoyCaptain::Stats::BounceRatesQuery.call(params)
  @stats = lazy_window(@stats.with_lazy_comparison(compare_mode?).group_by_period(selected_interval, "daily_bounce_rate.date").average("bounce_rate"))
  @label = "Bounce Rate"
end