2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
class RunnerEntity < Grape::Entity
|
|
|
|
include RequestAwareEntity
|
|
|
|
|
|
|
|
expose :id, :description
|
|
|
|
|
|
|
|
expose :edit_path,
|
2018-11-08 19:23:39 +05:30
|
|
|
if: -> (*) { can?(request.current_user, :admin_build, project) && runner.project_type? } do |runner|
|
2017-09-10 17:25:29 +05:30
|
|
|
edit_project_runner_path(project, runner)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
alias_method :runner, :object
|
|
|
|
|
|
|
|
def project
|
|
|
|
request.project
|
|
|
|
end
|
|
|
|
end
|