Skip to content

Commit

Permalink
Association from ConfigurationScript to AutomationManager
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswnl committed Jul 23, 2018
1 parent 525e7d9 commit 5c0831f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion app/models/configuration_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ class ConfigurationScript < ConfigurationScriptBase
def self.base_model
ConfigurationScript
end
belongs_to :manager, :class_name => "ExtManagementSystem", :inverse_of => :configuration_scripts
end
5 changes: 0 additions & 5 deletions app/models/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ 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,
:dependent => :destroy,
:foreign_key => "manager_id",
:inverse_of => :manager

validates :name, :presence => true, :uniqueness => {:scope => [:tenant_id]}
validates :hostname, :presence => true, :if => :hostname_required?
validate :hostname_uniqueness_valid?, :hostname_format_valid?, :if => :hostname_required?
Expand Down
6 changes: 6 additions & 0 deletions app/models/manageiq/providers/automation_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ 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",
:class_name => "::ConfigurationScript",
:inverse_of => :manager

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
Expand Down

0 comments on commit 5c0831f

Please sign in to comment.