From c170ac0c5bd7ea6213a6c4cf93c8f9a9180df5f2 Mon Sep 17 00:00:00 2001 From: Reiss Johnson Date: Fri, 6 Jun 2025 15:09:33 +0100 Subject: [PATCH] REW-2045 - rename expiring_link method to download_link (can then be over-ridden in MyRew) Correct typo --- app/models/concerns/csv2db/active_storage_adapter.rb | 4 ++-- app/views/csv2db/_csv_import_table.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/concerns/csv2db/active_storage_adapter.rb b/app/models/concerns/csv2db/active_storage_adapter.rb index 4dfc152..2b89cd6 100644 --- a/app/models/concerns/csv2db/active_storage_adapter.rb +++ b/app/models/concerns/csv2db/active_storage_adapter.rb @@ -28,7 +28,7 @@ def file=(file) self.file_name = filename end - def expiring_link(expires_in: LINK_MAX_EXPIRY) + def download_link(expires_in: LINK_MAX_EXPIRY) return unless file_attachment.present? set_current_host @@ -41,7 +41,7 @@ def expiring_link(expires_in: LINK_MAX_EXPIRY) def set_current_host return unless %i[test local].include?(Rails.application.config.active_storage.service) - ActiveStorage::Current.host = ReportGenerator.config.local_storage_host + ActiveStorage::Current.host = Csv2db.config.local_storage_host end def check_file_extension diff --git a/app/views/csv2db/_csv_import_table.html.haml b/app/views/csv2db/_csv_import_table.html.haml index acc0bcc..761eb89 100644 --- a/app/views/csv2db/_csv_import_table.html.haml +++ b/app/views/csv2db/_csv_import_table.html.haml @@ -16,7 +16,7 @@ %td= import.id %td= import.created_at - if Csv2db.config.storage_adapter.active_storage? - %td= link_to import.file_name, import.expiring_link + %td= link_to import.file_name, import.download_link - else %td= link_to import.file.name, import.file.url, target: '_blank' %td