Skip to content

Commit

Permalink
Adding PhysicalStorage into PhysicalChassis
Browse files Browse the repository at this point in the history
  • Loading branch information
EsdrasVP authored and unknown committed Jun 21, 2018
1 parent 245ce8b commit b8bfd6d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/ems_refresh/save_inventory_physical_infra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def save_physical_storages_inventory(ems, hashes, target = nil)

hashes.each do |h|
h[:physical_rack_id] = h.delete(:physical_rack).try(:[], :id)
h[:physical_chassis_id] = h.delete(:physical_chassis).try(:[], :id)
end

child_keys = %i(computer_system asset_detail)
Expand Down
1 change: 1 addition & 0 deletions app/models/physical_chassis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class PhysicalChassis < ApplicationRecord
belongs_to :physical_rack, :foreign_key => :physical_rack_id, :inverse_of => :physical_chassis

has_many :physical_servers, :dependent => :destroy, :inverse_of => :physical_chassis
has_many :physical_storages, :dependent => :destroy, :inverse_of => :physical_chassis

has_one :computer_system, :as => :managed_entity, :dependent => :destroy, :inverse_of => false
has_one :hardware, :through => :computer_system
Expand Down
2 changes: 1 addition & 1 deletion app/models/physical_storage.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class PhysicalStorage < ApplicationRecord
belongs_to :ext_management_system, :foreign_key => :ems_id, :inverse_of => :physical_storages,
:class_name => "ManageIQ::Providers::PhysicalInfraManager"

belongs_to :physical_rack, :foreign_key => :physical_rack_id, :inverse_of => :physical_storages
belongs_to :physical_chassis, :foreign_key => :physical_chassis_id, :inverse_of => :physical_storages

has_one :computer_system, :as => :managed_entity, :dependent => :destroy, :inverse_of => false
has_one :hardware, :through => :computer_system
Expand Down

0 comments on commit b8bfd6d

Please sign in to comment.