Skip auction for blocked and reserved domains

Closes #1120
This commit is contained in:
Artur Beljajev 2019-03-22 16:26:55 +02:00
parent ce1a5fd5f1
commit e6405c5fc8
4 changed files with 45 additions and 1 deletions

View file

@ -36,7 +36,7 @@ module Concerns
def release
if release_to_auction
transaction do
domain_name.sell_at_auction
domain_name.sell_at_auction if domain_name.auctionable?
destroy!
end
else

View file

@ -69,6 +69,10 @@ module DNS
ReservedDomain.where(name: name).any?
end
def auctionable?
!not_auctionable?
end
def to_s
name
end
@ -77,6 +81,10 @@ module DNS
attr_reader :name
def not_auctionable?
blocked? || reserved?
end
def zone_with_same_origin?
DNS::Zone.where(origin: name).any?
end