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

33 lines
663 B
Ruby
Raw Normal View History

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 }
end
2016-06-02 11:05:42 +05:30
private
def state
raw_data.state == 'closed' ? 'closed' : 'active'
end
end
end
end