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).
This commit is contained in:
Christophe Bliard
2023-01-20 11:41:21 +01:00
parent 44bfa1f8b4
commit 4fca1eaaea
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -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.