gitlab-org--gitlab-foss/app/serializers/build_action_entity.rb

25 lines
430 B
Ruby
Raw Normal View History

class BuildActionEntity < Grape::Entity
include RequestAwareEntity
expose :name do |build|
build.name
end
expose :path do |build|
play_namespace_project_job_path(
2016-11-10 11:50:55 -05:00
build.project.namespace,
build.project,
build)
end
expose :playable?, as: :playable
private
alias_method :build, :object
def playable?
2017-05-09 00:15:34 -04:00
build.playable? && can?(request.current_user, :update_build, build)
end
end