diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-03 09:59:25 +0300 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-23 11:11:48 +0300 |
commit | ba27f1b954e79713ec1905b46ee5ba1b940418f0 (patch) | |
tree | 740464cf3bc1c20fe45755e96e474261b9eac090 /app/serializers/pipeline_entity.rb | |
parent | 0e06cfc059af0b70b366ab1eaf75f7601fdcb5e1 (diff) |
Expose only status. ci_cd_status to status. Support abstract class.
Diffstat (limited to 'app/serializers/pipeline_entity.rb')
-rw-r--r-- | app/serializers/pipeline_entity.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/serializers/pipeline_entity.rb b/app/serializers/pipeline_entity.rb index 61f0f11d7d2..1c1fa9e3dee 100644 --- a/app/serializers/pipeline_entity.rb +++ b/app/serializers/pipeline_entity.rb @@ -12,11 +12,9 @@ class PipelineEntity < Grape::Entity end expose :details do - expose :status do |pipeline, options| - StatusEntity.represent( - pipeline.detailed_status(request.user), - options) - end + expose :detailed_status, + as: :status, + with: StatusEntity expose :duration expose :finished_at @@ -82,4 +80,8 @@ class PipelineEntity < Grape::Entity pipeline.cancelable? && can?(request.user, :update_pipeline, pipeline) end + + def detailed_status + pipeline.detailed_status(request.user) + end end |