Skip to content

Commit f56d3c7

Browse files
pirjJonRowe
authored andcommitted
Fix Rails deprecation warning
See e.g. https://github.com/rspec/rspec-rails/actions/runs/4746930554/jobs/8431194845 ``` -:io => (be blank), +:io => "/home/runner/work/rspec-rails/bundle/ruby/3.2.0/gems/rack-3.0.7/lib/rack/chunked.rb:6: warning: Rack::Chunked is deprecated and will be removed in Rack 3.1\n/home/runner/work/rspec-rails/bundle/ruby/3.2.0/bundler/gems/rails-795d52473740/activerecord/lib/active_record.rb:242:in `legacy_connection_handling=': The `legacy_connection_handling` setter was deprecated in 7.0 and removed in 7.1, but is still defined in your configuration. Please remove this call as it no longer has any effect.\" (ArgumentError)\n\tfrom /home/runner/work/rspec-rails/bundle/ruby/3.2.0/bundler/gems/rails-795d52473740/activerecord/lib/active_record/railtie.rb:270:in `block (3 levels) in <class:Railtie>'\n\tfrom /home/runner/work/rspec-rails/bundle/ruby/3.2.0 ``` According to https://guides.rubyonrails.org/configuring.html#default-values-for-target-version-6-1, it would have been `false` by default anyway.
1 parent 8848e6a commit f56d3c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

example_app_generator/spec/support/default_preview_path

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ require_file_stub 'config/environment' do
4848
config.action_mailer.show_previews = (ENV['SHOW_PREVIEWS'] == 'true')
4949
end
5050

51-
config.active_record.legacy_connection_handling = false if Rails::VERSION::STRING >= '7'
51+
config.active_record.legacy_connection_handling = false if Rails::VERSION::STRING.start_with?('7.0')
5252
end
5353
end
5454

0 commit comments

Comments
 (0)