From 834bcacbaec837d8ec0a269f111bca769843bcb4 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 7 Dec 2016 09:25:11 +0100 Subject: [PATCH] fix refactor of production event fetcher --- .../cycle_analytics/issue_event_fetcher.rb | 17 +++++++++++++++++ .../cycle_analytics/production_event_fetcher.rb | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/gitlab/cycle_analytics/issue_event_fetcher.rb b/lib/gitlab/cycle_analytics/issue_event_fetcher.rb index 69ba7c3cc9c..0d8da99455e 100644 --- a/lib/gitlab/cycle_analytics/issue_event_fetcher.rb +++ b/lib/gitlab/cycle_analytics/issue_event_fetcher.rb @@ -1,6 +1,23 @@ module Gitlab module CycleAnalytics class IssueEventFetcher < BaseEventFetcher + include IssueAllowed + + def initialize(*args) + @projections = [issue_table[:title], + issue_table[:iid], + issue_table[:id], + issue_table[:created_at], + issue_table[:author_id]] + + super(*args) + end + + private + + def serialize(event) + AnalyticsIssueSerializer.new(project: @project).represent(event).as_json + end end end end diff --git a/lib/gitlab/cycle_analytics/production_event_fetcher.rb b/lib/gitlab/cycle_analytics/production_event_fetcher.rb index 882e780874f..0fa2e87f673 100644 --- a/lib/gitlab/cycle_analytics/production_event_fetcher.rb +++ b/lib/gitlab/cycle_analytics/production_event_fetcher.rb @@ -1,23 +1,6 @@ module Gitlab module CycleAnalytics class ProductionEventFetcher < IssueEventFetcher - include IssueAllowed - - def initialize(*args) - @projections = [issue_table[:title], - issue_table[:iid], - issue_table[:id], - issue_table[:created_at], - issue_table[:author_id]] - - super(*args) - end - - private - - def serialize(event) - AnalyticsIssueSerializer.new(project: @project).represent(event).as_json - end end end end