Refactor envs helper for clarity

This commit is contained in:
syasonik 2019-01-29 17:58:04 -08:00
parent db054bc166
commit 5051f65497
1 changed files with 3 additions and 3 deletions

View File

@ -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!