stage_entity.rb 403 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
  expose :status do |stage, options|
    StatusEntity.represent(
      stage.detailed_status(request.user),
      options)
  end
Kamil Trzciński's avatar
Kamil Trzciński committed
10

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