remove IP pool rules when deleting an IP pool

This commit is contained in:
Adam Cooke
2017-05-15 10:43:44 +01:00
parent d33994ce0f
commit 9a76538f11
+1
View File
@@ -24,6 +24,7 @@ class IPPool < ApplicationRecord
has_many :servers, :dependent => :restrict_with_exception
has_many :organization_ip_pools, :dependent => :destroy
has_many :organizations, :through => :organization_ip_pools
has_many :ip_pool_rules, :dependent => :destroy
def self.default
where(:default => true).order(:id).first