diff options
Diffstat (limited to 'app/serializers/deployment_entity.rb')
-rw-r--r-- | app/serializers/deployment_entity.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/serializers/deployment_entity.rb b/app/serializers/deployment_entity.rb index 08a939e86c5..7a2fba73f3a 100644 --- a/app/serializers/deployment_entity.rb +++ b/app/serializers/deployment_entity.rb @@ -22,12 +22,14 @@ class DeploymentEntity < Grape::Entity expose :deployed_at expose :tag expose :last? + expose :last?, as: :is_last + expose :deployed_by, as: :user, using: UserEntity expose :deployable, if: -> (deployment) { deployment.deployable.present? } do |deployment, opts| deployment.deployable.yield_self do |deployable| if include_details? - JobEntity.represent(deployable, opts) + Ci::JobEntity.represent(deployable, opts) elsif can_read_deployables? { name: deployable.name, build_path: project_job_path(deployable.project, deployable) } @@ -36,10 +38,10 @@ class DeploymentEntity < Grape::Entity end expose :commit, using: CommitEntity, if: -> (*) { include_details? } - expose :manual_actions, using: JobEntity, if: -> (*) { include_details? && can_create_deployment? } - expose :scheduled_actions, using: JobEntity, if: -> (*) { include_details? && can_create_deployment? } + expose :manual_actions, using: Ci::JobEntity, if: -> (*) { include_details? && can_create_deployment? } + expose :scheduled_actions, using: Ci::JobEntity, if: -> (*) { include_details? && can_create_deployment? } expose :playable_build, if: -> (deployment) { include_details? && can_create_deployment? && deployment.playable_build } do |deployment, options| - JobEntity.represent(deployment.playable_build, options.merge(only: [:play_path, :retry_path])) + Ci::JobEntity.represent(deployment.playable_build, options.merge(only: [:play_path, :retry_path])) end expose :cluster do |deployment, options| |