Fix removed ip_pool type errors (#62)

* Fix undefined method description

Sice `:description` was removed from the IP pools it should display the IP pool `:name` instead of the `:description`.

* Fix using the removed ip_pool type
This commit is contained in:
Alex Bouma
2017-04-29 19:42:29 +01:00
committed by Adam Cooke
parent f779e45f45
commit ddf2a859bf
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -273,7 +273,7 @@ class Server < ApplicationRecord
end
def validate_ip_pool_belongs_to_organization
if self.ip_pool && self.ip_pool_id_changed? && (self.ip_pool.type == 'Dedicated' && !self.organization.ip_pools.include?(self.ip_pool))
if self.ip_pool && self.ip_pool_id_changed? && !self.organization.ip_pools.include?(self.ip_pool)
errors.add :ip_pool_id, "must belong to the organization"
end
end