gitlab-org--gitlab-foss/app/serializers/build_action_entity.rb
Toon Claes 16cca3a0ea Expose if action is playable in JSON
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.
2017-03-20 14:39:37 +01:00

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