Welcome to mirror list, hosted at ThFree Co, Russian Federation.

issue_event.rb « cycle_analytics « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9cfcdc9b20e323273a216858aa87768d5085090c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Gitlab
  module CycleAnalytics
    class IssueEvent < BaseEvent
      @stage = :issue
      @start_time_attrs = issue_table[:created_at]

      @end_time_attrs = [issue_metrics_table[:first_associated_with_milestone_at],
                         issue_metrics_table[:first_added_to_board_at]]

      @projections = [issue_table[:title],
                      issue_table[:iid],
                      issue_table[:id],
                      issue_table[:created_at],
                      issue_table[:author_id]]

      def self.serialize(event, query)
        event['author'] = User.find(event.delete('author_id'))

        AnalyticsIssueSerializer.new(project: query.project).represent(event).as_json
      end
    end
  end
end