Skip to content

Commit

Permalink
Merge pull request #17940 from xlab-si/physical-chassis-hierarchy
Browse files Browse the repository at this point in the history
Add accessors for physical chassis tree
  • Loading branch information
agrare authored Sep 10, 2018
2 parents 85265cd + b43d61e commit 17cf9b6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/models/physical_chassis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ class PhysicalChassis < ApplicationRecord
belongs_to :ext_management_system, :foreign_key => :ems_id, :inverse_of => :physical_chassis,
:class_name => "ManageIQ::Providers::PhysicalInfraManager"
belongs_to :physical_rack, :foreign_key => :physical_rack_id, :inverse_of => :physical_chassis
belongs_to :parent_physical_chassis,
:class_name => "PhysicalChassis",
:inverse_of => :child_physical_chassis

has_many :event_streams, :inverse_of => :physical_chassis, :dependent => :nullify
has_many :physical_servers, :dependent => :destroy, :inverse_of => :physical_chassis
has_many :physical_storages, :dependent => :destroy, :inverse_of => :physical_chassis
has_many :child_physical_chassis,
:class_name => "PhysicalChassis",
:dependent => :nullify,
:foreign_key => :parent_physical_chassis_id,
:inverse_of => :parent_physical_chassis

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

0 comments on commit 17cf9b6

Please sign in to comment.