BigW Consortium Gitlab

deployment_entity.rb 517 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
class DeploymentEntity < Grape::Entity
  include RequestAwareEntity

  expose :id
  expose :iid
  expose :sha

  expose :ref do
    expose :name do |deployment|
      deployment.ref
    end
12 13

    expose :ref_path do |deployment|
14
      project_tree_path(deployment.project, id: deployment.ref)
15
    end
16 17
  end

18
  expose :created_at
19 20
  expose :tag
  expose :last?
21 22 23

  expose :user, using: UserEntity
  expose :commit, using: CommitEntity
24 25
  expose :deployable, using: JobEntity
  expose :manual_actions, using: JobEntity
26
end