Skip to content

Commit

Permalink
Add accessors for physical chassis tree
Browse files Browse the repository at this point in the history
This commit exposes database schema changes to rails application.
  • Loading branch information
Tadej Borovšak committed Sep 10, 2018
1 parent 85265cd commit 0c36e88
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 => :destroy,
: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 0c36e88

Please sign in to comment.