diff --git a/app/services/spreadsheet_parser.rb b/app/services/spreadsheet_parser.rb index ef36175f4..bfb9745fb 100644 --- a/app/services/spreadsheet_parser.rb +++ b/app/services/spreadsheet_parser.rb @@ -1,8 +1,15 @@ +# frozen_string_literal: true + class SpreadsheetParser # Based on file's extension opens file (used for importing) def self.open_spreadsheet(file) - filename = file.original_filename - file_path = file.path + if file.class == ActionDispatch::Http::UploadedFile + filename = file.original_filename + file_path = file.path + else + filename = file.filename.to_s + file_path = file.service_url + end case File.extname(filename) when '.csv'