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:
Diffstat (limited to 'app/serializers/environment_serializer.rb')
-rw-r--r--app/serializers/environment_serializer.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/serializers/environment_serializer.rb b/app/serializers/environment_serializer.rb
index 22839ba3099..46d5a488aea 100644
--- a/app/serializers/environment_serializer.rb
+++ b/app/serializers/environment_serializer.rb
@@ -43,7 +43,7 @@ class EnvironmentSerializer < BaseSerializer
# immediately.
items = @paginator.paginate(items) if paginated?
- environments = batch_load(resource.where(id: items.map(&:last_id)))
+ environments = batch_load(Environment.where(id: items.map(&:last_id)))
environments_by_id = environments.index_by(&:id)
items.map do |item|
@@ -52,15 +52,13 @@ class EnvironmentSerializer < BaseSerializer
end
def batch_load(resource)
- temp_deployment_associations = deployment_associations
-
resource = resource.preload(environment_associations)
Preloaders::Environments::DeploymentPreloader.new(resource)
- .execute_with_union(:last_deployment, temp_deployment_associations)
+ .execute_with_union(:last_deployment, deployment_associations)
Preloaders::Environments::DeploymentPreloader.new(resource)
- .execute_with_union(:upcoming_deployment, temp_deployment_associations)
+ .execute_with_union(:upcoming_deployment, deployment_associations)
resource.to_a.tap do |environments|
environments.each do |environment|