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