From abce4c8cf43fdff329ff139ffe4adfa95a10034a Mon Sep 17 00:00:00 2001 From: James Wong Date: Thu, 12 Jul 2018 11:44:12 -0400 Subject: [PATCH] move configuration_scripts association up to ems --- app/models/configuration_script.rb | 2 +- app/models/ext_management_system.rb | 3 +-- app/models/manageiq/providers/automation_manager.rb | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/models/configuration_script.rb b/app/models/configuration_script.rb index b04ed38505cc..2e1e703f31cd 100644 --- a/app/models/configuration_script.rb +++ b/app/models/configuration_script.rb @@ -2,5 +2,5 @@ class ConfigurationScript < ConfigurationScriptBase def self.base_model ConfigurationScript end - belongs_to :manager, :class_name => "ExtManagementSystem", :inverse_of => :configuration_scripts_and_workflows + belongs_to :manager, :class_name => "ExtManagementSystem", :inverse_of => :configuration_scripts end diff --git a/app/models/ext_management_system.rb b/app/models/ext_management_system.rb index 6788fae32953..476d36a75995 100644 --- a/app/models/ext_management_system.rb +++ b/app/models/ext_management_system.rb @@ -76,8 +76,7 @@ def self.api_allowed_attributes has_many :miq_events, :as => :target, :dependent => :destroy has_many :cloud_subnets, :foreign_key => :ems_id, :dependent => :destroy - has_many :configuration_scripts_and_workflows, - :class_name => 'ConfigurationScript', + has_many :configuration_scripts, :dependent => :destroy, :foreign_key => "manager_id", :inverse_of => :manager diff --git a/app/models/manageiq/providers/automation_manager.rb b/app/models/manageiq/providers/automation_manager.rb index cd84a4adc9ea..906cd5866826 100644 --- a/app/models/manageiq/providers/automation_manager.rb +++ b/app/models/manageiq/providers/automation_manager.rb @@ -11,7 +11,6 @@ class ManageIQ::Providers::AutomationManager < ManageIQ::Providers::BaseManager has_many :configured_systems, :dependent => :destroy, :foreign_key => "manager_id" has_many :configuration_profiles, :dependent => :destroy, :foreign_key => "manager_id" - has_many :configuration_scripts, :dependent => :destroy, :foreign_key => "manager_id" has_many :configuration_workflows, :dependent => :destroy, :foreign_key => "manager_id", :inverse_of => :manager has_many :credentials, :class_name => "ManageIQ::Providers::AutomationManager::Authentication", :as => :resource, :dependent => :destroy