2018-11-17 00:37:17 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-24 21:45:31 +00:00
|
|
|
module Gitlab
|
2017-10-13 16:50:36 +00:00
|
|
|
module LegacyGithubImport
|
2016-08-24 21:45:31 +00:00
|
|
|
class ReleaseFormatter < BaseFormatter
|
|
|
|
def attributes
|
|
|
|
{
|
|
|
|
project: project,
|
|
|
|
tag: raw_data.tag_name,
|
2019-04-09 06:52:15 +00:00
|
|
|
name: raw_data.name,
|
2016-08-24 21:45:31 +00:00
|
|
|
description: raw_data.body,
|
|
|
|
created_at: raw_data.created_at,
|
2019-07-03 09:12:15 +00:00
|
|
|
released_at: raw_data.published_at,
|
2016-08-24 21:45:31 +00:00
|
|
|
updated_at: raw_data.created_at
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2016-10-19 18:42:31 +00:00
|
|
|
def project_association
|
|
|
|
:releases
|
|
|
|
end
|
|
|
|
|
|
|
|
def find_condition
|
|
|
|
{ tag: raw_data.tag_name }
|
2016-08-24 21:45:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def valid?
|
|
|
|
!raw_data.draft
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|