From d4d97193ceab1a562b4be9cd728554a5b8e3526b Mon Sep 17 00:00:00 2001 From: lauramccluskey Date: Mon, 29 Jan 2024 16:21:46 +0000 Subject: [PATCH] make changes from code review --- lib/import/brca/providers/oxford/oxford_handler.rb | 2 +- .../colorectal/providers/oxford/oxford_handler_colorectal.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/import/brca/providers/oxford/oxford_handler.rb b/lib/import/brca/providers/oxford/oxford_handler.rb index 1693a8b1..79d455e6 100644 --- a/lib/import/brca/providers/oxford/oxford_handler.rb +++ b/lib/import/brca/providers/oxford/oxford_handler.rb @@ -27,7 +27,7 @@ def process_fields(record) def brca_file? file_name = @batch.original_filename - file_path = file_name.slice(0, file_name.rindex('/')) + file_path = File.dirname(file_name) file_path_array = file_name.split('/') pseudo_file = file_path_array[file_path_array.length - 1] pseudo_filename = pseudo_file.sub(/.xls[x]?.pseudo/, '') diff --git a/lib/import/colorectal/providers/oxford/oxford_handler_colorectal.rb b/lib/import/colorectal/providers/oxford/oxford_handler_colorectal.rb index 4ee03fdc..069dd371 100644 --- a/lib/import/colorectal/providers/oxford/oxford_handler_colorectal.rb +++ b/lib/import/colorectal/providers/oxford/oxford_handler_colorectal.rb @@ -26,7 +26,7 @@ def process_fields(record) def colorectal_file? file_name = @batch.original_filename - file_path = file_name.slice(0, file_name.rindex('/')) + file_path = File.dirname(file_name) file_path_array = file_name.split('/') pseudo_file = file_path_array[file_path_array.length - 1] pseudo_filename = pseudo_file.sub(/.xls[x]?.pseudo/, '')