Commit 0b6d01ed authored by Lin Jen-Shin's avatar Lin Jen-Shin

Just define allowed_ids and override it with empty value

if not needed for those sub-classes.
parent 45568bed
......@@ -56,10 +56,6 @@ module Gitlab
end
def allowed_ids
nil
end
def load_allowed_ids
allowed_ids_finder_class
.new(@options[:current_user], project_id: @project.id)
.execute.where(id: event_result_ids).pluck(:id)
......
......@@ -19,10 +19,6 @@ module Gitlab
AnalyticsMergeRequestSerializer.new(project: @project).represent(event)
end
def allowed_ids
load_allowed_ids
end
def allowed_ids_finder_class
MergeRequestsFinder
end
......
......@@ -17,10 +17,6 @@ module Gitlab
AnalyticsIssueSerializer.new(project: @project).represent(event)
end
def allowed_ids
load_allowed_ids
end
def allowed_ids_finder_class
IssuesFinder
end
......
......@@ -19,6 +19,10 @@ module Gitlab
private
def allowed_ids
nil
end
def merge_request_diff_commits
@merge_request_diff_commits ||=
MergeRequestDiffCommit
......
......@@ -18,10 +18,6 @@ module Gitlab
AnalyticsMergeRequestSerializer.new(project: @project).represent(event)
end
def allowed_ids
load_allowed_ids
end
def allowed_ids_finder_class
MergeRequestsFinder
end
......
......@@ -22,6 +22,10 @@ module Gitlab
private
def allowed_ids
nil
end
def serialize(event)
AnalyticsBuildSerializer.new.represent(event['build'])
end
......
......@@ -23,6 +23,8 @@ describe Gitlab::CycleAnalytics::BaseEventFetcher do
allow_any_instance_of(described_class).to receive(:serialize) do |event|
event
end
allow_any_instance_of(described_class)
.to receive(:allowed_ids).and_return(nil)
stub_const('Gitlab::CycleAnalytics::BaseEventFetcher::MAX_EVENTS', max_events)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment