2017-05-23 15:10:07 +00:00
|
|
|
class RunnerEntity < Grape::Entity
|
2017-05-26 08:31:42 +00:00
|
|
|
include RequestAwareEntity
|
|
|
|
|
|
|
|
expose :id, :description
|
|
|
|
|
2017-05-29 07:58:20 +00:00
|
|
|
expose :edit_path,
|
|
|
|
if: -> (*) { can?(request.current_user, :admin_build, project) && runner.specific? } do |runner|
|
2017-05-26 08:31:42 +00:00
|
|
|
edit_namespace_project_runner_path(project.namespace, project, runner)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2017-05-29 07:58:20 +00:00
|
|
|
alias_method :runner, :object
|
|
|
|
|
2017-05-26 08:31:42 +00:00
|
|
|
def project
|
|
|
|
request.project
|
|
|
|
end
|
2017-05-23 15:10:07 +00:00
|
|
|
end
|