debian-mirror-gitlab/app/serializers/deployment_entity.rb

30 lines
586 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
class DeploymentEntity < Grape::Entity
include RequestAwareEntity
expose :id
expose :iid
expose :sha
expose :ref do
expose :name do |deployment|
deployment.ref
end
expose :ref_path do |deployment|
namespace_project_tree_path(
deployment.project.namespace,
deployment.project,
id: deployment.ref)
end
end
expose :created_at
expose :tag
expose :last?
expose :user, using: UserEntity
expose :commit, using: CommitEntity
expose :deployable, using: BuildEntity
expose :manual_actions, using: BuildEntity
end