stage_entity.rb 404 Bytes
Newer Older
1
class StageEntity < Grape::Entity
Kamil Trzciński's avatar
Kamil Trzciński committed
2 3
  include RequestAwareEntity

4
  expose :name
5

6 7 8 9 10
  expose :status do |stage, options|
    StatusEntity.represent(
      stage.detailed_status(request.user),
      options)
  end
Kamil Trzciński's avatar
Kamil Trzciński committed
11

12
  expose :path do |stage|
Kamil Trzciński's avatar
Kamil Trzciński committed
13 14 15 16 17 18 19
    namespace_project_pipeline_path(
      stage.pipeline.project.namespace,
      stage.pipeline.project,
      stage.pipeline.id,
      anchor: stage.name)
  end
end