111297422-validation_method_fix

This commit is contained in:
Stas 2016-01-11 16:26:54 +02:00
parent 1370a5f0fe
commit 830afc0e0e

View file

@ -38,7 +38,7 @@ class DomainNameValidator < ActiveModel::EachValidator
def validate_blocked(value)
return true unless value
return false if BlockedDomain.where("names @> ?::varchar[]", "{#{value}}").count > 0
return false if BlockedDomain.where(name: value).count > 0
ZonefileSetting.where(origin: value).count == 0
end
end