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

19 lines
356 B
Ruby
Raw Normal View History

class RunnerEntity < Grape::Entity
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|
edit_project_runner_path(project, runner)
end
private
2017-05-29 03:58:20 -04:00
alias_method :runner, :object
def project
request.project
end
end