From 516ed3c3fc75c877b1eafe8c0ed277721f72bc8b Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Wed, 8 Aug 2018 16:13:01 -0400 Subject: [PATCH] Add an association for Datacenters Datacenters are a subclass of EmsFolder but have their own inventory collection. This will allow us use the standard association attribute for an inventory_collection rather than having to define a custom arel like Ovirt does today. --- app/models/ext_management_system.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/ext_management_system.rb b/app/models/ext_management_system.rb index 746a9cf5a2f..8caab97c584 100644 --- a/app/models/ext_management_system.rb +++ b/app/models/ext_management_system.rb @@ -61,6 +61,7 @@ def self.api_allowed_attributes has_many :blacklisted_events, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system has_many :miq_alert_statuses, :foreign_key => "ems_id", :dependent => :destroy has_many :ems_folders, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system + has_many :datacenters, :foreign_key => "ems_id", :class_name => "Datacenter", :inverse_of => :ext_management_system has_many :ems_clusters, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system has_many :resource_pools, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system has_many :customization_specs, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system