71777a4a18
Rename other URL generators admin_builds_path -> admin_jobs_path Fix tests and more renaming Fix more tests Also change build_id to job_id in the controller
24 lines
430 B
Ruby
24 lines
430 B
Ruby
class BuildActionEntity < Grape::Entity
|
|
include RequestAwareEntity
|
|
|
|
expose :name do |build|
|
|
build.name
|
|
end
|
|
|
|
expose :path do |build|
|
|
play_namespace_project_job_path(
|
|
build.project.namespace,
|
|
build.project,
|
|
build)
|
|
end
|
|
|
|
expose :playable?, as: :playable
|
|
|
|
private
|
|
|
|
alias_method :build, :object
|
|
|
|
def playable?
|
|
build.playable? && can?(request.current_user, :update_build, build)
|
|
end
|
|
end
|