Remove redundant variable `temp_deployment_associations`
Proposal
diff --git a/app/serializers/environment_serializer.rb b/app/serializers/environment_serializer.rb
index beee5522a06..32da22740b2 100644
--- a/app/serializers/environment_serializer.rb
+++ b/app/serializers/environment_serializer.rb
@@ -52,15 +52,13 @@ def itemize(resource)
end
def batch_load(resource)
- temp_deployment_associations = deployment_associations
-
resource = resource.preload(environment_associations.except(:last_deployment, :upcoming_deployment))
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|
Edited by Shinya Maeda