hide away IP pool things in the UI if not enabled

This commit is contained in:
Adam Cooke
2017-04-27 09:41:21 +01:00
parent 1f64c61105
commit 61da4bf48c
6 changed files with 12 additions and 16 deletions
+1 -3
View File
@@ -47,7 +47,7 @@ class Server < ApplicationRecord
include HasSoftDestroy
belongs_to :organization
belongs_to :ip_pool
belongs_to :ip_pool, :optional => true
has_many :domains, :dependent => :destroy, :as => :owner
has_many :credentials, :dependent => :destroy
has_many :smtp_endpoints, :dependent => :destroy
@@ -280,7 +280,6 @@ class Server < ApplicationRecord
def ip_pool_for_message(message)
if message.scope == 'outgoing'
[self, self.organization].each do |scope|
rules = scope.ip_pool_rules.order(:created_at => :desc)
rules.each do |rule|
@@ -289,7 +288,6 @@ class Server < ApplicationRecord
end
end
end
self.ip_pool
else
nil