BigW Consortium Gitlab

issue_formatter.rb 683 Bytes
Newer Older
1 2
module Gitlab
  module GithubImport
3
    class IssueFormatter < IssuableFormatter
4 5
      def attributes
        {
6
          iid: number,
7
          project: project,
8
          milestone: milestone,
9 10 11 12
          title: raw_data.title,
          description: description,
          state: state,
          author_id: author_id,
13
          assignee_ids: Array(assignee_id),
14
          created_at: raw_data.created_at,
15
          updated_at: raw_data.updated_at
16 17 18 19 20 21 22
        }
      end

      def has_comments?
        raw_data.comments > 0
      end

23 24 25 26
      def project_association
        :issues
      end

27 28
      def pull_request?
        raw_data.pull_request.present?
29 30 31 32
      end
    end
  end
end