Skip to content

Commit 70853e5

Browse files
authored
Merge pull request #21 from CreatekIO/REW-2045-file-upload-restrictions-csv-uploads-on-the-admin-area
REW-2045 - rename expiring_link method to download_link (can then be over-ridden in MyRew)
2 parents 4d526e4 + c170ac0 commit 70853e5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/models/concerns/csv2db/active_storage_adapter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def file=(file)
2828
self.file_name = filename
2929
end
3030

31-
def expiring_link(expires_in: LINK_MAX_EXPIRY)
31+
def download_link(expires_in: LINK_MAX_EXPIRY)
3232
return unless file_attachment.present?
3333

3434
set_current_host
@@ -41,7 +41,7 @@ def expiring_link(expires_in: LINK_MAX_EXPIRY)
4141
def set_current_host
4242
return unless %i[test local].include?(Rails.application.config.active_storage.service)
4343

44-
ActiveStorage::Current.host = ReportGenerator.config.local_storage_host
44+
ActiveStorage::Current.host = Csv2db.config.local_storage_host
4545
end
4646

4747
def check_file_extension

app/views/csv2db/_csv_import_table.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
%td= import.id
1717
%td= import.created_at
1818
- if Csv2db.config.storage_adapter.active_storage?
19-
%td= link_to import.file_name, import.expiring_link
19+
%td= link_to import.file_name, import.download_link
2020
- else
2121
%td= link_to import.file.name, import.file.url, target: '_blank'
2222
%td

0 commit comments

Comments
 (0)