mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
Validate only puny label length #2608
This commit is contained in:
parent
1654f87e04
commit
5c68eb558c
6 changed files with 21 additions and 16 deletions
|
@ -1,11 +1,4 @@
|
|||
class DomainNameValidator < ActiveModel::EachValidator
|
||||
# TODO
|
||||
# validates lenght of 2-63
|
||||
# validates/honours Estonian additional letters zäõüö
|
||||
# honours punicode and all interfces honors utf8
|
||||
# validates lower level domains (.pri.ee, edu.ee etc)
|
||||
# lower level domains are fixed for .ee and can add statically into settings
|
||||
|
||||
def validate_each(record, attribute, value)
|
||||
if !self.class.validate_format(value)
|
||||
record.errors[attribute] << (options[:message] || record.errors.generate_message(attribute, :invalid))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue