1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Refactor: Allow other import files (#1099)

* Rename stimulus controller

* feature: rename raw_csv_str to raw_file_str
This commit is contained in:
Pedro Carmona 2024-08-19 14:25:07 +01:00 committed by GitHub
parent e6528bafec
commit 0c1ff00c1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 71 additions and 57 deletions

View file

@ -11,8 +11,8 @@ class Import::Csv
)
end
def self.create_with_field_mappings(raw_csv_str, fields, field_mappings, col_sep = DEFAULT_COL_SEP)
raw_csv = self.parse_csv(raw_csv_str, col_sep:)
def self.create_with_field_mappings(raw_file_str, fields, field_mappings, col_sep = DEFAULT_COL_SEP)
raw_csv = self.parse_csv(raw_file_str, col_sep:)
generated_csv_str = CSV.generate headers: fields.map { |f| f.key }, write_headers: true, col_sep: do |csv|
raw_csv.each do |row|