fix issues

This commit is contained in:
olegphenomenon 2022-04-22 14:04:29 +03:00
parent 9766650ae4
commit 3b9ff74bd2
7 changed files with 66 additions and 14 deletions

View file

@ -9,7 +9,7 @@ class Auction < ApplicationRecord
domain_not_registered: 'domain_not_registered',
}
enum platform: %i[blind english]
enum platform: %i[automatically manually]
PENDING_STATUSES = [statuses[:started],
statuses[:awaiting_payment],
@ -21,6 +21,14 @@ class Auction < ApplicationRecord
where(status: status) if status.present?
}
scope :with_start_created_at_date, -> (start_created_at) {
where("created_at >= ?", start_created_at) if start_created_at.present?
}
scope :with_end_created_at_date, -> (end_created_at) {
where("created_at <= ?", end_created_at) if end_created_at.present?
}
def self.pending(domain_name)
find_by(domain: domain_name.to_s, status: PENDING_STATUSES)
end

View file

@ -35,7 +35,7 @@ module DNS
def sell_at_auction
auction = Auction.new
auction.domain = name
auction.platform = 'blind'
auction.platform = 'automatically'
auction.start
ToStdout.msg "Created the auction: #{auction.inspect}"
update_whois_from_auction(auction)