diff --git a/app/models/vm_or_template.rb b/app/models/vm_or_template.rb index fe80d1918010..a80312b4ebdf 100644 --- a/app/models/vm_or_template.rb +++ b/app/models/vm_or_template.rb @@ -60,6 +60,8 @@ class VmOrTemplate < ApplicationRecord has_one :miq_server, :foreign_key => :vm_id, :inverse_of => :vm + has_one :flavor, -> { where(:flavors => {:name => '?'}) }, :primary_key => :id, :inverse_of => :vm + has_one :operating_system, :dependent => :destroy has_one :hardware, :dependent => :destroy has_many :disks, :through => :hardware