mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 23:42:04 +02:00
Reason when domain is taken
This commit is contained in:
parent
d2e30c0c5f
commit
9c08edeb36
2 changed files with 12 additions and 4 deletions
|
@ -16,7 +16,11 @@ class Domain < ActiveRecord::Base
|
|||
next
|
||||
end
|
||||
|
||||
res << {name: x, avail: Domain.find_by(name: x) ? 0 : 1}
|
||||
if Domain.find_by(name: x)
|
||||
res << {name: x, avail: 0, reason: 'in use'}
|
||||
else
|
||||
res << {name: x, avail: 1}
|
||||
end
|
||||
end
|
||||
|
||||
res
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue