This commit is contained in:
Martin Lensment 2015-07-08 18:00:21 +03:00
parent 647d074b8b
commit b6dd532171
7 changed files with 18 additions and 13 deletions

View file

@ -42,10 +42,10 @@ class DomainNameValidator < ActiveModel::EachValidator
BlockedDomain.where("names @> ?::varchar[]", "{#{value}}").count == 0
end
def validate_reservation(record, value)
return true unless value
return true if record.reserved_pw == record.auth_info
!ReservedDomain.exists?(name: value.mb_chars.downcase.strip)
end
# def validate_reservation(record, value)
# return true unless value
# return true if record.reserved_pw == record.auth_info
# !ReservedDomain.exists?(name: value.mb_chars.downcase.strip)
# end
end
end