diff options
author | Małgorzata Ksionek <mksionek@gitlab.com> | 2019-07-04 13:40:32 +0200 |
---|---|---|
committer | Małgorzata Ksionek <mksionek@gitlab.com> | 2019-07-09 12:16:37 +0200 |
commit | abca34d08ea855638a6e431becc65eb98f10cdb6 (patch) | |
tree | 8c88d83d6827c219578ba4441ae9753ef0656d6e /lib/gitlab/cycle_analytics/base_event_fetcher.rb | |
parent | 68a5e20532b5ca18e8bc3f59ee880faec50cd91c (diff) | |
download | gitlab-ce-abca34d08ea855638a6e431becc65eb98f10cdb6.tar.gz |
Modify base class for cycle analytics fetching
Diffstat (limited to 'lib/gitlab/cycle_analytics/base_event_fetcher.rb')
-rw-r--r-- | lib/gitlab/cycle_analytics/base_event_fetcher.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/cycle_analytics/base_event_fetcher.rb b/lib/gitlab/cycle_analytics/base_event_fetcher.rb index 304d60996a6..0b8d5089a5b 100644 --- a/lib/gitlab/cycle_analytics/base_event_fetcher.rb +++ b/lib/gitlab/cycle_analytics/base_event_fetcher.rb @@ -9,7 +9,7 @@ module Gitlab MAX_EVENTS = 50 - def initialize(project:, stage:, options:) + def initialize(project: nil, stage:, options:) @project = project @stage = stage @options = options @@ -59,13 +59,17 @@ module Gitlab def allowed_ids @allowed_ids ||= allowed_ids_finder_class - .new(@options[:current_user], project_id: @project.id) + .new(@options[:current_user], allowed_ids_source) .execute.where(id: event_result_ids).pluck(:id) end def event_result_ids event_result.map { |event| event['id'] } end + + def allowed_ids_source + { project_id: @project.id } + end end end end |