Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/concerns/csv2db/active_storage_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/csv2db/_csv_import_table.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down