Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-05-26 11:31:42 +0300
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-05-31 22:44:53 +0300
commit68569584b728ac2dd5100593e9db302f362994f5 (patch)
tree1558a088e7aa5ad988e30cea791ec938a6d63ded /app/serializers/runner_entity.rb
parent47a0276e53de4635df43124607ac1a101d6f1b70 (diff)
Create PipelineDetailsEntity
Now we have a PipelineEntity which is a bit smaller, mostly in bytes needing to send to the frontend. PipelineDetailsEntity is the default for the PipelineSerializer, limiting the changes needed. This commit also incorporates the review.
Diffstat (limited to 'app/serializers/runner_entity.rb')
-rw-r--r--app/serializers/runner_entity.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/serializers/runner_entity.rb b/app/serializers/runner_entity.rb
index 77d6de6e84c..00d8bf9f59c 100644
--- a/app/serializers/runner_entity.rb
+++ b/app/serializers/runner_entity.rb
@@ -1,3 +1,16 @@
class RunnerEntity < Grape::Entity
- expose :id, :name, :description
+ include RequestAwareEntity
+
+ expose :id, :description
+
+ expose :edit_runner_path,
+ if: -> (*) { can?(request.current_user, :admin_build, project) } do |runner|
+ edit_namespace_project_runner_path(project.namespace, project, runner)
+ end
+
+ private
+
+ def project
+ request.project
+ end
end