mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 05:26:17 +02:00
renamed column in auction from type to platform
This commit is contained in:
parent
d8c0ba2432
commit
9766650ae4
9 changed files with 16 additions and 15 deletions
|
@ -24,24 +24,25 @@ module Admin
|
|||
end
|
||||
|
||||
def create
|
||||
auction = Auction.new(domain: params[:domain], status: Auction.statuses[:started], platform: :english)
|
||||
auction = Auction.new(domain: params[:domain], status: Auction.statuses[:started], platform: 'english')
|
||||
|
||||
if auction.save
|
||||
remove_from_reserved(auction)
|
||||
flash[:notice] = "Auction #{params[:domain]} created"
|
||||
else
|
||||
flash[:alert] = "Something goes wrong"
|
||||
flash[:alert] = 'Something goes wrong'
|
||||
end
|
||||
|
||||
redirect_to admin_auctions_path
|
||||
end
|
||||
|
||||
def upload_spreadsheet
|
||||
table = CSV.parse(File.read(params[:q][:file]), headers: true)
|
||||
filename = params[:q][:file]
|
||||
table = CSV.parse(File.read(filename), headers: true)
|
||||
|
||||
table.each do |row|
|
||||
record = row.to_h
|
||||
auction = Auction.new(domain: record['name'], status: Auction.statuses[:started], platform: :english)
|
||||
auction = Auction.new(domain: record['name'], status: Auction.statuses[:started], platform: 'english')
|
||||
remove_from_reserved(auction) if auction.save!
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue