Skip to content

Commit

Permalink
Fix deprecation warning on Rails 7
Browse files Browse the repository at this point in the history
The way to change the current host changed on Rails 7.

See rails/rails#41388

[skip ci]
  • Loading branch information
waiting-for-dev committed Aug 14, 2023
1 parent 3d49081 commit 017dc8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile-local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gem "pry-byebug"
7 changes: 6 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@

if defined?(ActiveStorage::Current)
config.before(:all) do
ActiveStorage::Current.host = 'https://www.example.com'
test_host = 'https://www.example.com'
if Rails.gem_version >= Gem::Version.new(7)
ActiveStorage::Current.url_options = { host: test_host }
else
ActiveStorage::Current.host = test_host
end
end
end

Expand Down

0 comments on commit 017dc8e

Please sign in to comment.