diff --git a/app/models/configuration_script_base.rb b/app/models/configuration_script_base.rb index 38e472852d0..b22d134d73e 100644 --- a/app/models/configuration_script_base.rb +++ b/app/models/configuration_script_base.rb @@ -9,7 +9,10 @@ class ConfigurationScriptBase < ApplicationRecord belongs_to :manager, :class_name => "ExtManagementSystem" belongs_to :parent, :class_name => "ConfigurationScriptBase" - has_many :children, :class_name => "ConfigurationScriptBase", :foreign_key => "parent_id" + has_many :children, + :class_name => "ConfigurationScriptBase", + :foreign_key => "parent_id", + :dependent => :nullify has_many :authentication_configuration_script_bases, :dependent => :destroy diff --git a/app/models/configuration_script_source.rb b/app/models/configuration_script_source.rb index 19807c1fc36..3144f279185 100644 --- a/app/models/configuration_script_source.rb +++ b/app/models/configuration_script_source.rb @@ -1,5 +1,5 @@ class ConfigurationScriptSource < ApplicationRecord - has_many :configuration_script_payloads + has_many :configuration_script_payloads, :dependent => :destroy belongs_to :authentication belongs_to :manager, :class_name => "ExtManagementSystem"