mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 02:04:33 +08:00
SCI-3994 fix for excel import
This commit is contained in:
parent
50231b3c15
commit
0af8629f98
2 changed files with 9 additions and 7 deletions
|
@ -17,12 +17,14 @@ module ImportRepository
|
|||
private
|
||||
|
||||
def run_import_actions
|
||||
@temp_file.file.open do |temp_file|
|
||||
@repository.import_records(
|
||||
SpreadsheetParser.open_spreadsheet(@temp_file.file),
|
||||
SpreadsheetParser.open_spreadsheet(temp_file),
|
||||
@mappings,
|
||||
@user
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def run_checks
|
||||
unless @mappings
|
||||
|
|
|
@ -7,8 +7,8 @@ class SpreadsheetParser
|
|||
filename = file.original_filename
|
||||
file_path = file.path
|
||||
else
|
||||
filename = file.filename.to_s
|
||||
file_path = file.service_url
|
||||
filename = File.basename(file.path)
|
||||
file_path = file.path
|
||||
end
|
||||
|
||||
case File.extname(filename)
|
||||
|
|
Loading…
Reference in a new issue