mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +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
|
@ -70,7 +70,7 @@ class Domain < ActiveRecord::Base
|
|||
after_save :update_whois_record
|
||||
|
||||
validates :name_dirty, domain_name: true, uniqueness: true
|
||||
validates :name_puny, length: { maximum: 66 }
|
||||
validates :puny_label, length: { maximum: 63 }
|
||||
validates :period, numericality: { only_integer: true }
|
||||
validates :registrant, :registrar, presence: true
|
||||
|
||||
|
@ -160,6 +160,10 @@ class Domain < ActiveRecord::Base
|
|||
"EIS-#{id}"
|
||||
end
|
||||
|
||||
def puny_label
|
||||
name_puny.to_s.split('.').first
|
||||
end
|
||||
|
||||
def registrant_typeahead
|
||||
@registrant_typeahead || registrant.try(:name) || nil
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue