Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add accessors for physical chassis tree #17940

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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