diff --git a/app/models/physical_rack.rb b/app/models/physical_rack.rb index e2ae9498d3cc..10f69e554354 100644 --- a/app/models/physical_rack.rb +++ b/app/models/physical_rack.rb @@ -5,7 +5,8 @@ class PhysicalRack < ApplicationRecord include SupportsFeatureMixin include EventMixin - belongs_to :ext_management_system, :foreign_key => :ems_id, :class_name => "ManageIQ::Providers::PhysicalInfraManager" + belongs_to :ext_management_system, :foreign_key => :ems_id, + :class_name => "ManageIQ::Providers::PhysicalInfraManager", :inverse_of => :physical_racks has_many :physical_servers, :dependent => :destroy, :inverse_of => :physical_rack end diff --git a/spec/factories/physical_rack.rb b/spec/factories/physical_rack.rb new file mode 100644 index 000000000000..00f100085f40 --- /dev/null +++ b/spec/factories/physical_rack.rb @@ -0,0 +1,3 @@ +FactoryGirl.define do + factory :physical_rack +end