提交 39abe2bb 编写于 作者: G Grzegorz Bizon

Merge branch '49388-refactor' into 'master'

Refactor helper in environments controller for clarity

See merge request gitlab-org/gitlab-ce!24781
...@@ -182,11 +182,11 @@ class Projects::EnvironmentsController < Projects::ApplicationController ...@@ -182,11 +182,11 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end end
def serialize_environments(request, response, nested = false) def serialize_environments(request, response, nested = false)
serializer = EnvironmentSerializer EnvironmentSerializer
.new(project: @project, current_user: @current_user) .new(project: @project, current_user: @current_user)
.tap { |serializer| serializer.within_folders if nested }
.with_pagination(request, response) .with_pagination(request, response)
serializer = serializer.within_folders if nested .represent(@environments)
serializer.represent(@environments)
end end
def authorize_stop_environment! def authorize_stop_environment!
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册