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 ...@@ -56,10 +56,6 @@ module Gitlab
end end
def allowed_ids def allowed_ids
nil
end
def load_allowed_ids
allowed_ids_finder_class allowed_ids_finder_class
.new(@options[:current_user], project_id: @project.id) .new(@options[:current_user], project_id: @project.id)
.execute.where(id: event_result_ids).pluck(:id) .execute.where(id: event_result_ids).pluck(:id)
......
...@@ -19,10 +19,6 @@ module Gitlab ...@@ -19,10 +19,6 @@ module Gitlab
AnalyticsMergeRequestSerializer.new(project: @project).represent(event) AnalyticsMergeRequestSerializer.new(project: @project).represent(event)
end end
def allowed_ids
load_allowed_ids
end
def allowed_ids_finder_class def allowed_ids_finder_class
MergeRequestsFinder MergeRequestsFinder
end end
......
...@@ -17,10 +17,6 @@ module Gitlab ...@@ -17,10 +17,6 @@ module Gitlab
AnalyticsIssueSerializer.new(project: @project).represent(event) AnalyticsIssueSerializer.new(project: @project).represent(event)
end end
def allowed_ids
load_allowed_ids
end
def allowed_ids_finder_class def allowed_ids_finder_class
IssuesFinder IssuesFinder
end end
......
...@@ -19,6 +19,10 @@ module Gitlab ...@@ -19,6 +19,10 @@ module Gitlab
private private
def allowed_ids
nil
end
def merge_request_diff_commits def merge_request_diff_commits
@merge_request_diff_commits ||= @merge_request_diff_commits ||=
MergeRequestDiffCommit MergeRequestDiffCommit
......
...@@ -18,10 +18,6 @@ module Gitlab ...@@ -18,10 +18,6 @@ module Gitlab
AnalyticsMergeRequestSerializer.new(project: @project).represent(event) AnalyticsMergeRequestSerializer.new(project: @project).represent(event)
end end
def allowed_ids
load_allowed_ids
end
def allowed_ids_finder_class def allowed_ids_finder_class
MergeRequestsFinder MergeRequestsFinder
end end
......
...@@ -22,6 +22,10 @@ module Gitlab ...@@ -22,6 +22,10 @@ module Gitlab
private private
def allowed_ids
nil
end
def serialize(event) def serialize(event)
AnalyticsBuildSerializer.new.represent(event['build']) AnalyticsBuildSerializer.new.represent(event['build'])
end end
......
...@@ -23,6 +23,8 @@ describe Gitlab::CycleAnalytics::BaseEventFetcher do ...@@ -23,6 +23,8 @@ describe Gitlab::CycleAnalytics::BaseEventFetcher do
allow_any_instance_of(described_class).to receive(:serialize) do |event| allow_any_instance_of(described_class).to receive(:serialize) do |event|
event event
end end
allow_any_instance_of(described_class)
.to receive(:allowed_ids).and_return(nil)
stub_const('Gitlab::CycleAnalytics::BaseEventFetcher::MAX_EVENTS', max_events) 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