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 6, 2018
1 parent 26bf79c commit fb7ffbf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/models/physical_chassis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ 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 => :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 :physical_chassis,
: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 fb7ffbf

Please sign in to comment.