Class: Gitlab::LegacyGithubImport::MilestoneFormatter

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

Instance Attribute Summary

Attributes inherited from BaseFormatter

#client, #formatter, #project, #raw_data

Instance Method Summary collapse

Methods inherited from BaseFormatter

#create!, #initialize, #url

Constructor Details

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

Instance Method Details

#attributesObject


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

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

#find_conditionObject


23
24
25
# File 'lib/gitlab/legacy_github_import/milestone_formatter.rb', line 23

def find_condition
  { iid: number }
end

#numberObject


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

def number
  if project.gitea_import?
    raw_data.id
  else
    raw_data.number
  end
end

#project_associationObject


19
20
21
# File 'lib/gitlab/legacy_github_import/milestone_formatter.rb', line 19

def project_association
  :milestones
end