diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-02-04 14:59:54 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-02-04 14:59:54 +0300 |
commit | 39abe2bbe777b72ea262882d83a2b8127fecf8c7 (patch) | |
tree | da92de2bc4246da42b8ead03a831160e21e27d44 | |
parent | ce36b109e478ff063bfcda8dd705c6ea25eededf (diff) | |
parent | 5051f6549732bead5d4df5cc576c6104c5afa6f3 (diff) |
Merge branch '49388-refactor' into 'master'
Refactor helper in environments controller for clarity
See merge request gitlab-org/gitlab-ce!24781
-rw-r--r-- | app/controllers/projects/environments_controller.rb | 6 |
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! |