debian-mirror-gitlab/lib/gitlab/legacy_github_import/milestone_formatter.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
816 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2016-06-02 11:05:42 +05:30
module Gitlab
2018-03-17 18:26:18 +05:30
module LegacyGithubImport
2016-06-02 11:05:42 +05:30
class MilestoneFormatter < BaseFormatter
def attributes
{
2017-08-17 22:00:37 +05:30
iid: number,
2016-06-02 11:05:42 +05:30
project: project,
2016-09-29 09:46:39 +05:30
title: raw_data.title,
description: raw_data.description,
due_date: raw_data.due_on,
2016-06-02 11:05:42 +05:30
state: state,
2016-09-29 09:46:39 +05:30
created_at: raw_data.created_at,
updated_at: raw_data.updated_at
2016-06-02 11:05:42 +05:30
}
end
2016-11-03 12:29:30 +05:30
def project_association
:milestones
end
def find_condition
2017-08-17 22:00:37 +05:30
{ iid: number }
end
def number
if project.gitea_import?
raw_data.id
else
raw_data.number
end
end
2016-06-02 11:05:42 +05:30
private
def state
raw_data.state == 'closed' ? 'closed' : 'active'
end
end
end
end