Skip to content

Commit

Permalink
Merge pull request #13833 from Ladas/include_snaphosts_to_avoid_n_plu…
Browse files Browse the repository at this point in the history
…s_1_queries

Avoid N+1 queries by including snapshots
  • Loading branch information
kbrock authored Feb 23, 2017
2 parents 489bf7c + 41a55af commit efc4e73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_provision_virt_workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit efc4e73

Please sign in to comment.