Class: Gitlab::LegacyGithubImport::LabelFormatter
Instance Attribute Summary
#client, #formatter, #project, #raw_data
Instance Method Summary
collapse
#initialize, #url
Instance Method Details
#attributes ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/gitlab/legacy_github_import/label_formatter.rb', line 6
def attributes
{
project: project,
title: title,
color: color
}
end
|
#create! ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'lib/gitlab/legacy_github_import/label_formatter.rb', line 18
def create!
params = attributes.except(:project)
service = ::Labels::FindOrCreateService.new(nil, project, params)
label = service.execute(skip_authorization: true)
raise ActiveRecord::RecordInvalid, label unless label.persisted?
label
end
|
#project_association ⇒ Object
14
15
16
|
# File 'lib/gitlab/legacy_github_import/label_formatter.rb', line 14
def project_association
:labels
end
|