gitlab-org--gitlab-foss/app/serializers/runner_entity.rb
2018-07-23 11:27:39 -07:00

20 lines
391 B
Ruby

# frozen_string_literal: true
class RunnerEntity < Grape::Entity
include RequestAwareEntity
expose :id, :description
expose :edit_path,
if: -> (*) { can?(request.current_user, :admin_build, project) && runner.project_type? } do |runner|
edit_project_runner_path(project, runner)
end
private
alias_method :runner, :object
def project
request.project
end
end