2016-11-07 04:08:18 -05:00
|
|
|
module CycleAnalyticsParams
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
2016-11-23 05:28:28 -05:00
|
|
|
def options(params)
|
|
|
|
@options ||= { from: start_date(params), current_user: current_user }
|
2016-11-22 08:29:25 -05:00
|
|
|
end
|
|
|
|
|
2016-11-07 04:08:18 -05:00
|
|
|
def start_date(params)
|
|
|
|
params[:start_date] == '30' ? 30.days.ago : 90.days.ago
|
|
|
|
end
|
|
|
|
end
|