debian-mirror-gitlab/app/controllers/concerns/cycle_analytics_params.rb

12 lines
259 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
module CycleAnalyticsParams
extend ActiveSupport::Concern
def options(params)
@options ||= { from: start_date(params), current_user: current_user }
end
def start_date(params)
params[:start_date] == '30' ? 30.days.ago : 90.days.ago
end
end