Fix deprecation warning

It set Rails.application.config.active_record.legacy_connection_handling to false, as would Rails 6.1 default do. This removes a deprecation warning showing up each time tests are run, and enables granular connection swapping (which we do not use currently, but this may change in the future).
pull/11957/head
Christophe Bliard 2 years ago
parent 44bfa1f8b4
commit 4fca1eaaea
No known key found for this signature in database
GPG Key ID: 2BC07603210C3FA4
  1. 8
      config/application.rb
  2. 4
      config/initializers/new_framework_defaults_6_1.rb

@ -64,6 +64,14 @@ module OpenProject
# files. See https://community.openproject.org/wp/45463 for details.
# config.load_defaults 5.0
# Use new connection handling API. For most applications this won't have any
# effect. For applications using multiple databases, this new API provides
# support for granular connection swapping.
# It has to be done here to prevent having the deprecation warning
# displayed. This line and its comment can safely be removed
# once `config.load_defaults 6.1` is used.
config.active_record.legacy_connection_handling = false
# Sets up logging for STDOUT and configures the default logger formatter
# so that all environments receive level and timestamp information
#

@ -57,8 +57,8 @@
# Use new connection handling API. For most applications this won't have any
# effect. For applications using multiple databases, this new API provides
# support for granular connection swapping.
# Previous versions had false. Rails 6.1+ default is true.
# Rails.application.config.active_record.legacy_connection_handling = false
# Previous versions had true. Rails 6.1+ default is false.
Rails.application.config.active_record.legacy_connection_handling = false
# https://guides.rubyonrails.org/configuring.html#config-action-view-form-with-generates-remote-forms
# Make `form_with` generate non-remote forms by default.

Loading…
Cancel
Save