remove wildcard validation on routes

closes #57
This commit is contained in:
Adam Cooke
2017-04-30 19:26:10 +01:00
parent 2be702fac3
commit 6af6e58d88
-9
View File
@@ -42,7 +42,6 @@ class Route < ApplicationRecord
validate :validate_domain_belongs_to_server
validate :validate_endpoint_belongs_to_server
validate :validate_name_uniqueness
validate :validate_wildcard
validate :validate_return_path_route_endpoints
validate :validate_no_additional_routes_on_non_endpoint_route
@@ -180,14 +179,6 @@ class Route < ApplicationRecord
end
end
def validate_wildcard
if self.wildcard?
if self.endpoint_type == 'SMTPEndpoint' || self.endpoint_type == 'AddressEndpoint'
errors.add :base, "Wildcard routes cannot be routed to SMTP servers or addresses"
end
end
end
def validate_domain_belongs_to_server
if self.domain && ![self.server, self.server.organization].include?(self.domain.owner)
errors.add :domain, :invalid