From 41a55afb818df8c23e47ce66d14d367934cd9820 Mon Sep 17 00:00:00 2001 From: Ladislav Smola Date: Thu, 9 Feb 2017 10:59:47 +0100 Subject: [PATCH] Avoid N+1 queries by including snapshots Avoid N+1 queries by including snapshots --- app/models/miq_provision_virt_workflow.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/miq_provision_virt_workflow.rb b/app/models/miq_provision_virt_workflow.rb index 6ddf70796e2..6b475816174 100644 --- a/app/models/miq_provision_virt_workflow.rb +++ b/app/models/miq_provision_virt_workflow.rb @@ -326,7 +326,7 @@ def allowed_templates(options = {}) end end - MiqPreloader.preload(allowed_templates_list, [:operating_system, :ext_management_system, {:hardware => :disks}]) + MiqPreloader.preload(allowed_templates_list, [:snapshots, :operating_system, :ext_management_system, {:hardware => :disks}]) @allowed_templates_cache = allowed_templates_list.collect do |template| create_hash_struct_from_vm_or_template(template, options) end