diff --git a/app/controllers/admin/auctions_controller.rb b/app/controllers/admin/auctions_controller.rb index 22c186b17..ca3065108 100644 --- a/app/controllers/admin/auctions_controller.rb +++ b/app/controllers/admin/auctions_controller.rb @@ -24,7 +24,7 @@ module Admin end def create - auction = Auction.new(domain: params[:domain], status: Auction.statuses[:started]) + auction = Auction.new(domain: params[:domain], status: Auction.statuses[:started], platform: :english) if auction.save remove_from_reserved(auction) @@ -41,7 +41,7 @@ module Admin table.each do |row| record = row.to_h - auction = Auction.new(domain: record['name'], status: Auction.statuses[:started]) + auction = Auction.new(domain: record['name'], status: Auction.statuses[:started], platform: :english) remove_from_reserved(auction) if auction.save! end diff --git a/app/controllers/admin/reserved_domains_controller.rb b/app/controllers/admin/reserved_domains_controller.rb index dc9ff9d15..2e5cff63c 100644 --- a/app/controllers/admin/reserved_domains_controller.rb +++ b/app/controllers/admin/reserved_domains_controller.rb @@ -58,7 +58,7 @@ module Admin reserved_domains = ReservedDomain.where(id: reserved_domains_ids) reserved_domains.each do |domain| - Auction.create!(domain: domain.name, status: Auction.statuses[:started]) + Auction.create!(domain: domain.name, status: Auction.statuses[:started], platform: :english) domain.destroy! end diff --git a/app/models/auction.rb b/app/models/auction.rb index fd48c22f2..208425f4d 100644 --- a/app/models/auction.rb +++ b/app/models/auction.rb @@ -9,6 +9,8 @@ class Auction < ApplicationRecord domain_not_registered: 'domain_not_registered', } + enum type: %i[blind english] + PENDING_STATUSES = [statuses[:started], statuses[:awaiting_payment], statuses[:payment_received]].freeze diff --git a/app/models/dns/domain_name.rb b/app/models/dns/domain_name.rb index bceb4433b..3fe4760ac 100644 --- a/app/models/dns/domain_name.rb +++ b/app/models/dns/domain_name.rb @@ -35,6 +35,7 @@ module DNS def sell_at_auction auction = Auction.new auction.domain = name + auction.platform = :blind auction.start ToStdout.msg "Created the auction: #{auction.inspect}" update_whois_from_auction(auction) diff --git a/app/views/admin/auctions/index.html.erb b/app/views/admin/auctions/index.html.erb index d3f9f7745..2ea206671 100644 --- a/app/views/admin/auctions/index.html.erb +++ b/app/views/admin/auctions/index.html.erb @@ -114,6 +114,9 @@