BigW Consortium Gitlab

deployment_entity.rb 586 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 14 15 16 17 18

    expose :ref_path do |deployment|
      namespace_project_tree_path(
        deployment.project.namespace,
        deployment.project,
        id: deployment.ref)
    end
19 20
  end

21
  expose :created_at
22 23
  expose :tag
  expose :last?
24 25 26 27 28

  expose :user, using: UserEntity
  expose :commit, using: CommitEntity
  expose :deployable, using: BuildEntity
  expose :manual_actions, using: BuildEntity
29
end