2016-06-02 11:05:42 +05:30
|
|
|
module Gitlab
|
|
|
|
module GithubImport
|
|
|
|
class MilestoneFormatter < BaseFormatter
|
|
|
|
def attributes
|
|
|
|
{
|
2016-09-29 09:46:39 +05:30
|
|
|
iid: raw_data.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
|
|
|
|
{ iid: raw_data.number }
|
2016-06-16 23:09:34 +05:30
|
|
|
end
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
private
|
|
|
|
|
|
|
|
def state
|
|
|
|
raw_data.state == 'closed' ? 'closed' : 'active'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|