summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyasonik <syasonik@gitlab.com>2019-01-29 17:58:04 -0800
committersyasonik <syasonik@gitlab.com>2019-01-29 17:58:04 -0800
commit5051f6549732bead5d4df5cc576c6104c5afa6f3 (patch)
tree6d2fcc7c5bb5654d2a4456a5e7c4cbf6d004fc95
parentdb054bc1668e2c9a1d745d00dbe3ba4dd74f6929 (diff)
downloadgitlab-ce-5051f6549732bead5d4df5cc576c6104c5afa6f3.tar.gz
Refactor envs helper for clarity
-rw-r--r--app/controllers/projects/environments_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb
index 1a1b024d766..4e85de25c6b 100644
--- a/app/controllers/projects/environments_controller.rb
+++ b/app/controllers/projects/environments_controller.rb
@@ -182,11 +182,11 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
def serialize_environments(request, response, nested = false)
- serializer = EnvironmentSerializer
+ EnvironmentSerializer
.new(project: @project, current_user: @current_user)
+ .tap { |serializer| serializer.within_folders if nested }
.with_pagination(request, response)
- serializer = serializer.within_folders if nested
- serializer.represent(@environments)
+ .represent(@environments)
end
def authorize_stop_environment!