From 25dfbe50855f40d3302731b7fb98774b7f480032 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Fri, 10 Nov 2023 13:30:43 +0100 Subject: [PATCH] chore: fix ActiveStorage::Current.host deprecation warning --- app/controllers/application_controller.rb | 3 ++- spec/rails_helper.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index eb4dc8d81..05291ef1a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -177,7 +177,8 @@ class ApplicationController < ActionController::Base private def set_active_storage_host - ActiveStorage::Current.host = request.base_url + ActiveStorage::Current.url_options ||= {} + ActiveStorage::Current.url_options[:host] = request.base_url end def setup_javascript_settings diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index a45eeceb5..8ccfede35 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -86,7 +86,7 @@ RSpec.configure do |config| ActionMailer::Base.deliveries.clear - ActiveStorage::Current.host = 'http://test.host' + ActiveStorage::Current.url_options = { host: 'http://test.host' } Geocoder.configure(lookup: :test) end