Skip to content

Commit

Permalink
Fix Rails deprecation warning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pirj authored and JonRowe committed May 4, 2023
1 parent 8848e6a commit f56d3c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example_app_generator/spec/support/default_preview_path
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require_file_stub 'config/environment' do
config.action_mailer.show_previews = (ENV['SHOW_PREVIEWS'] == 'true')
end

config.active_record.legacy_connection_handling = false if Rails::VERSION::STRING >= '7'
config.active_record.legacy_connection_handling = false if Rails::VERSION::STRING.start_with?('7.0')
end
end

Expand Down

0 comments on commit f56d3c7

Please sign in to comment.