Class: Gitlab::LegacyGithubImport::MilestoneFormatter

Inherits:
BaseFormatter
  • Object
show all
Includes:
Import::UsernameMentionRewriter
Defined in:
lib/gitlab/legacy_github_import/milestone_formatter.rb

Constant Summary

Constants included from Import::UsernameMentionRewriter

Import::UsernameMentionRewriter::MENTION_REGEX

Instance Attribute Summary

Attributes inherited from BaseFormatter

#client, #formatter, #project, #raw_data, #source_user_mapper

Instance Method Summary collapse

Methods included from Import::UsernameMentionRewriter

#update_username_mentions, #wrap_mentions_in_backticks

Methods inherited from BaseFormatter

#create!, #create_record, #imported_from, #initialize, #push_placeholder_reference, #push_placeholder_references, #url

Constructor Details

This class inherits a constructor from Gitlab::LegacyGithubImport::BaseFormatter

Instance Method Details

#attributesObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gitlab/legacy_github_import/milestone_formatter.rb', line 8

def attributes
  {
    iid: number,
    project: project,
    title: raw_data[:title],
    description: description,
    due_date: raw_data[:due_on],
    state: state,
    created_at: raw_data[:created_at],
    updated_at: raw_data[:updated_at]
  }
end

#contributing_user_formattersObject



37
38
39
# File 'lib/gitlab/legacy_github_import/milestone_formatter.rb', line 37

def contributing_user_formatters
  {}
end

#descriptionObject



41
42
43
# File 'lib/gitlab/legacy_github_import/milestone_formatter.rb', line 41

def description
  wrap_mentions_in_backticks(raw_data[:description])
end

#find_conditionObject



25
26
27
# File 'lib/gitlab/legacy_github_import/milestone_formatter.rb', line 25

def find_condition
  { iid: number }
end

#numberObject



29
30
31
32
33
34
35
# File 'lib/gitlab/legacy_github_import/milestone_formatter.rb', line 29

def number
  if project.gitea_import?
    raw_data[:id]
  else
    raw_data[:number]
  end
end

#project_associationObject



21
22
23
# File 'lib/gitlab/legacy_github_import/milestone_formatter.rb', line 21

def project_association
  :milestones
end