From e575c10ff20d894729c78b5f1d46a17ad9ab76a4 Mon Sep 17 00:00:00 2001 From: Lan Pham Date: Mon, 28 Apr 2025 14:02:39 +0100 Subject: [PATCH 1/2] Using Current.url_options.host instead of Current.host as deprecated --- .../report_generator/active_storage_download_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/concerns/report_generator/active_storage_download_adapter.rb b/app/concerns/report_generator/active_storage_download_adapter.rb index b36a13e..23d99ca 100644 --- a/app/concerns/report_generator/active_storage_download_adapter.rb +++ b/app/concerns/report_generator/active_storage_download_adapter.rb @@ -9,7 +9,7 @@ def expiring_link(expires_in: ReportGenerator::Download::MAX_EXPIRY) return self.remote_file_url if self.remote_file_url.present? && !self.report.attached? if %i[local test].include?(Rails.application.config.active_storage.service) - ActiveStorage::Current.host = ReportGenerator.config.local_storage_host + ActiveStorage::Current.url_options.host = ReportGenerator.config.local_storage_host end self.report.url(expires_in: expires_in.to_i, disposition: "attachment") From c0654f95b06d32a9ec87bceaec845ae3ad2330f4 Mon Sep 17 00:00:00 2001 From: Lan Pham Date: Mon, 28 Apr 2025 14:39:46 +0100 Subject: [PATCH 2/2] Update host to a hash --- .../report_generator/active_storage_download_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/concerns/report_generator/active_storage_download_adapter.rb b/app/concerns/report_generator/active_storage_download_adapter.rb index 23d99ca..5adbab6 100644 --- a/app/concerns/report_generator/active_storage_download_adapter.rb +++ b/app/concerns/report_generator/active_storage_download_adapter.rb @@ -9,7 +9,7 @@ def expiring_link(expires_in: ReportGenerator::Download::MAX_EXPIRY) return self.remote_file_url if self.remote_file_url.present? && !self.report.attached? if %i[local test].include?(Rails.application.config.active_storage.service) - ActiveStorage::Current.url_options.host = ReportGenerator.config.local_storage_host + ActiveStorage::Current.url_options = { host: ReportGenerator.config.local_storage_host } end self.report.url(expires_in: expires_in.to_i, disposition: "attachment")