Allow custom column separator for CSV parsing in uploads controller (#1470)

* Allow custom column separator for CSV parsing in uploads controller

* Add column separator parameter for CSV uploads in tests
This commit is contained in:
Alex
2024-11-18 08:31:17 -08:00
committed by GitHub
parent 8b672c4062
commit 9cc9f42bdc
2 changed files with 7 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ class Import::UploadsController < ApplicationController
require "csv"
begin
csv = CSV.parse(str || "", headers: true)
csv = CSV.parse(str || "", headers: true, col_sep: upload_params[:col_sep])
return false if csv.headers.empty?
return false if csv.count == 0
true