1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +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

@ -40,7 +40,7 @@ class ImportsController < ApplicationController
def upload_csv
begin
@import.raw_csv_str = import_params[:raw_csv_str].read
@import.raw_file_str = import_params[:raw_file_str].read
rescue NoMethodError
flash.now[:alert] = "Please select a file to upload"
render :load, status: :unprocessable_entity and return
@ -113,6 +113,6 @@ class ImportsController < ApplicationController
end
def import_params(permitted_mappings = nil)
params.require(:import).permit(:raw_csv_str, column_mappings: permitted_mappings, csv_update: [ :row_idx, :col_idx, :value ])
params.require(:import).permit(:raw_file_str, column_mappings: permitted_mappings, csv_update: [ :row_idx, :col_idx, :value ])
end
end