Reason when domain is taken

This commit is contained in:
Martin Lensment 2014-06-30 14:46:04 +03:00
parent d2e30c0c5f
commit 9c08edeb36
2 changed files with 12 additions and 4 deletions

View file

@ -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