Class: Gitlab::LegacyGithubImport::ReleaseFormatter
Instance Attribute Summary
#client, #formatter, #project, #raw_data
Instance Method Summary
collapse
#create!, #initialize, #url
Instance Method Details
#attributes ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/gitlab/legacy_github_import/release_formatter.rb', line 6
def attributes
{
project: project,
tag: raw_data[:tag_name],
name: raw_data[:name],
description: raw_data[:body],
created_at: raw_data[:created_at],
released_at: raw_data[:published_at] || Time.current,
updated_at: raw_data[:created_at]
}
end
|
#find_condition ⇒ Object
23
24
25
|
# File 'lib/gitlab/legacy_github_import/release_formatter.rb', line 23
def find_condition
{ tag: raw_data[:tag_name] }
end
|
#project_association ⇒ Object
19
20
21
|
# File 'lib/gitlab/legacy_github_import/release_formatter.rb', line 19
def project_association
:releases
end
|
#valid? ⇒ Boolean
27
28
29
|
# File 'lib/gitlab/legacy_github_import/release_formatter.rb', line 27
def valid?
!raw_data[:draft] && raw_data[:tag_name].present?
end
|