mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 19:44:09 +00:00
Refactor: Allow other import files (#1099)
* Rename stimulus controller * feature: rename raw_csv_str to raw_file_str
This commit is contained in:
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user