2016-04-18 12:44:27 -04:00
|
|
|
module Gitlab
|
|
|
|
module GithubImport
|
|
|
|
class MilestoneFormatter < BaseFormatter
|
|
|
|
def attributes
|
|
|
|
{
|
2016-08-30 15:20:56 -04:00
|
|
|
iid: raw_data.number,
|
2016-04-18 12:44:27 -04:00
|
|
|
project: project,
|
2016-08-30 15:20:56 -04:00
|
|
|
title: raw_data.title,
|
|
|
|
description: raw_data.description,
|
|
|
|
due_date: raw_data.due_on,
|
2016-04-18 12:44:27 -04:00
|
|
|
state: state,
|
2016-08-30 15:20:56 -04:00
|
|
|
created_at: raw_data.created_at,
|
|
|
|
updated_at: raw_data.updated_at
|
2016-04-18 12:44:27 -04:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2016-10-19 14:42:31 -04:00
|
|
|
def project_association
|
|
|
|
:milestones
|
|
|
|
end
|
|
|
|
|
|
|
|
def find_condition
|
|
|
|
{ iid: raw_data.number }
|
2016-05-18 17:14:20 -04:00
|
|
|
end
|
|
|
|
|
2016-04-18 12:44:27 -04:00
|
|
|
private
|
|
|
|
|
|
|
|
def state
|
|
|
|
raw_data.state == 'closed' ? 'closed' : 'active'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|