mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 22:16:19 +02:00
added exception for auctions with no-bids and registred-domains statuses
This commit is contained in:
parent
2323dd24b9
commit
f81daff3b2
1 changed files with 12 additions and 1 deletions
|
@ -111,7 +111,18 @@ module Admin
|
|||
Domain.exists?(name: domain_name) ||
|
||||
BlockedDomain.exists?(name: domain_name) ||
|
||||
Dispute.exists?(domain_name: domain_name) ||
|
||||
Auction.exists?(domain: domain_name)
|
||||
exception_for_registred_or_unbided_existed_auctions(domain_name)
|
||||
end
|
||||
|
||||
def exception_for_registred_or_unbided_existed_auctions(domain_name)
|
||||
return false unless Auction.exists?(domain: domain_name)
|
||||
|
||||
auctions = Auction.where(domain: domain_name).order(:created_at)
|
||||
last_record = auctions.last
|
||||
|
||||
return false if last_record.domain_registered? || last_record.no_bids?
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
def validate_table(table)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue