1
0
Fork 0
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:
Alex 2024-11-18 08:31:17 -08:00 committed by GitHub
parent 8b672c4062
commit 9cc9f42bdc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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