fixes issue with creating new organizations when there are no ip pools

This commit is contained in:
Adam Cooke
2017-04-27 10:34:22 +01:00
parent 10794f8573
commit 3ed9438a00
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -48,7 +48,9 @@ class Organization < ApplicationRecord
has_many :ip_pool_rules, :dependent => :destroy, :as => :owner
after_create do
self.ip_pools << IPPool.transactional.default
if pool = IPPool.transactional.default
self.ip_pools << IPPool.transactional.default
end
end
def status