Skip to content

Commit

Permalink
Fixing Computer System association on Physical Storage
Browse files Browse the repository at this point in the history
  • Loading branch information
EsdrasVP committed Sep 5, 2018
1 parent bb7d748 commit c4e15d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/models/ems_refresh/save_inventory_physical_infra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def save_physical_storages_inventory(ems, hashes, target = nil)
h[:physical_chassis_id] = h.delete(:physical_chassis).try(:[], :id)
end

child_keys = %i(computer_system asset_detail physical_disk canister)
child_keys = %i(asset_detail physical_disk canister)
save_inventory_multi(ems.physical_storages, hashes, deletes, [:ems_ref], child_keys)
store_ids_for_new_records(ems.physical_storages, hashes, :ems_ref)
end
Expand Down
8 changes: 4 additions & 4 deletions app/models/physical_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ 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, :through => :canisters

has_many :canister_computer_systems, :through => :canisters, :source => :computer_system

supports :refresh_ems

Expand Down

0 comments on commit c4e15d9

Please sign in to comment.