16cca3a0ea
To avoid a manual build action being played (resulting in a 404), expose `playable?` in the JSON so the frontend can disable/hide the play button if it's not playable.
16 lines
294 B
Ruby
16 lines
294 B
Ruby
class BuildActionEntity < Grape::Entity
|
|
include RequestAwareEntity
|
|
|
|
expose :name do |build|
|
|
build.name
|
|
end
|
|
|
|
expose :path do |build|
|
|
play_namespace_project_build_path(
|
|
build.project.namespace,
|
|
build.project,
|
|
build)
|
|
end
|
|
|
|
expose :playable?, as: :playable
|
|
end
|