From 673f88a5925ffa6b4ed4eb1082207adac59a93b9 Mon Sep 17 00:00:00 2001 From: felipedf Date: Thu, 25 Jan 2018 09:53:59 -0300 Subject: [PATCH] adding inverse_of to ems in PhysicalRack --- app/models/physical_rack.rb | 3 ++- spec/factories/physical_rack.rb | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 spec/factories/physical_rack.rb 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