mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
Domain name validation through EPP
This commit is contained in:
parent
b592b973ff
commit
d2e30c0c5f
3 changed files with 14 additions and 4 deletions
|
@ -11,6 +11,11 @@ class Domain < ActiveRecord::Base
|
|||
def check_availability(domains)
|
||||
res = []
|
||||
domains.each do |x|
|
||||
if !DomainNameValidator.validate(x)
|
||||
res << {name: x, avail: 0, reason: 'invalid format'}
|
||||
next
|
||||
end
|
||||
|
||||
res << {name: x, avail: Domain.find_by(name: x) ? 0 : 1}
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue