diff options
author | Felipe Artur <fcardozo@gitlab.com> | 2017-07-07 15:08:49 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-07-07 15:08:49 +0000 |
commit | b5f596c3ffb655b6e4fee127fa9336c829198b5b (patch) | |
tree | 202d725fcd56434b82c37037645f88839013ba53 /lib | |
parent | 1a3edcec4363239a4d080bc9af53d9d455dccfb4 (diff) | |
download | gitlab-ce-b5f596c3ffb655b6e4fee127fa9336c829198b5b.tar.gz |
Native group milestones
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 94168fa4ebc..fdc0c562248 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -255,7 +255,7 @@ module API class ProjectEntity < Grape::Entity expose :id, :iid - expose(:project_id) { |entity| entity.project.id } + expose(:project_id) { |entity| entity&.project.try(:id) } expose :title, :description expose :state, :created_at, :updated_at end @@ -267,7 +267,12 @@ module API expose :deleted_file?, as: :deleted_file end - class Milestone < ProjectEntity + class Milestone < Grape::Entity + expose :id, :iid + expose(:project_id) { |entity| entity&.project_id } + expose(:group_id) { |entity| entity&.group_id } + expose :title, :description + expose :state, :created_at, :updated_at expose :due_date expose :start_date end |