From a774358b39fce7ace2e072ce44a241c705a52c6d Mon Sep 17 00:00:00 2001 From: Esdras Vidal Date: Tue, 4 Sep 2018 17:07:21 -0300 Subject: [PATCH] Fixing Computer System association on Physical Storage --- app/models/physical_storage.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models/physical_storage.rb b/app/models/physical_storage.rb index 9c7ea8e7bf9..9d71b0b1b46 100644 --- a/app/models/physical_storage.rb +++ b/app/models/physical_storage.rb @@ -9,12 +9,14 @@ class PhysicalStorage < ApplicationRecord has_one :asset_detail, :as => :resource, :dependent => :destroy, :inverse_of => false has_many :canisters, :dependent => :destroy, :inverse_of => false - has_many :computer_system, :through => :canisters - has_many :hardware, :through => :computer_system - has_many :guest_devices, :through => :canisters - has_many :physical_disks, :dependent => :destroy, :inverse_of => :physical_storage + has_one :computer_system, :as => :managed_entity, :dependent => :destroy + has_one :hardware, :through => :computer_system + + has_many :canister_computer_systems, :through => :canisters, :source => :computer_system + has_many :guest_devices, :through => :hardware + supports :refresh_ems def my_zone