mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 16:02:03 +02:00
Domain name improvements
This commit is contained in:
parent
c5355ca8f5
commit
51091679c4
6 changed files with 34 additions and 6 deletions
|
@ -1,7 +1,6 @@
|
|||
class Domain < ActiveRecord::Base
|
||||
#TODO whois requests ip whitelist for full info for own domains and partial info for other domains
|
||||
#TODO most inputs should be trimmed before validatation, probably some global logic?
|
||||
|
||||
|
||||
belongs_to :registrar
|
||||
belongs_to :ns_set
|
||||
|
@ -11,6 +10,13 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
validates :name, domain_name: true
|
||||
|
||||
def name=(value)
|
||||
value.strip!
|
||||
write_attribute(:name, SimpleIDN.to_unicode(value))
|
||||
write_attribute(:name_puny, SimpleIDN.to_ascii(value))
|
||||
write_attribute(:name_dirty, value)
|
||||
end
|
||||
|
||||
class << self
|
||||
def check_availability(domains)
|
||||
res = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue