diff options
author | James Lopez <james@jameslopez.es> | 2016-11-22 14:29:25 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-01-17 11:32:54 +0100 |
commit | 02e1e4819234662faddd7d8eb5c54d9bfdf9e7e6 (patch) | |
tree | d789f920c5d3dd66f140c9dcfe774ac158623ca4 /app/controllers/concerns/cycle_analytics_params.rb | |
parent | 8639ea1b0315045c0e4a5ad8d6419903507850c3 (diff) | |
download | gitlab-ce-02e1e4819234662faddd7d8eb5c54d9bfdf9e7e6.tar.gz |
more refactoring and fixing old specs
Diffstat (limited to 'app/controllers/concerns/cycle_analytics_params.rb')
-rw-r--r-- | app/controllers/concerns/cycle_analytics_params.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/concerns/cycle_analytics_params.rb b/app/controllers/concerns/cycle_analytics_params.rb index 2aaf8f2b451..91456561a17 100644 --- a/app/controllers/concerns/cycle_analytics_params.rb +++ b/app/controllers/concerns/cycle_analytics_params.rb @@ -1,6 +1,10 @@ module CycleAnalyticsParams extend ActiveSupport::Concern + def options + @options ||= { from: start_date(events_params), current_user: current_user } + end + def start_date(params) params[:start_date] == '30' ? 30.days.ago : 90.days.ago end |