mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
Let domain to to draft status
This commit is contained in:
parent
e9e1e057f5
commit
7f26c8c769
6 changed files with 32 additions and 14 deletions
|
@ -8,9 +8,9 @@ class DomainNameValidator < ActiveModel::EachValidator
|
|||
|
||||
def validate_each(record, attribute, value)
|
||||
if !self.class.validate_format(value)
|
||||
record.errors[attribute] << (options[:message] || 'invalid format')
|
||||
record.errors[attribute] << (options[:message] || record.errors.generate_message(attribute, :invalid))
|
||||
elsif !self.class.validate_reservation(value)
|
||||
record.errors.add(attribute, (options[:message] || :reserved))
|
||||
record.errors.add(attribute, (options[:message] || record.errors.generate_message(attribute, :reserved)))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue