mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 23:42:04 +02:00
Tests #2806
This commit is contained in:
parent
e8e730a6e1
commit
1a7360cc3c
3 changed files with 40 additions and 23 deletions
|
@ -33,7 +33,8 @@ class DomainNameValidator < ActiveModel::EachValidator
|
|||
|
||||
def validate_blocked(value)
|
||||
return true unless value
|
||||
BlockedDomain.where("names @> ?::varchar[]", "{#{value}}").count == 0
|
||||
return false if BlockedDomain.where("names @> ?::varchar[]", "{#{value}}").count > 0
|
||||
ZonefileSetting.where(origin: value).count == 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue