mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-03 04:25:21 +02:00
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:
parent
8b672c4062
commit
9cc9f42bdc
2 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue