mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 14:58:05 -05:00
Eliminate Rails 7 warning about Active Record legacy connection handling
DEPRECATION WARNING: Using legacy connection handling is deprecated.
Please set `legacy_connection_handling` to `false` in your application.
This commit is contained in:
@@ -49,5 +49,9 @@ module RailsApp
|
||||
if Devise::Test.rails52_and_up? && !Devise::Test.rails6_and_up?
|
||||
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
|
||||
end
|
||||
|
||||
if Devise::Test.rails7_and_up?
|
||||
config.active_record.legacy_connection_handling = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,6 +8,10 @@ module Devise
|
||||
module Test
|
||||
# Detection for minor differences between Rails versions in tests.
|
||||
|
||||
def self.rails7_and_up?
|
||||
Rails::VERSION::MAJOR >= 7
|
||||
end
|
||||
|
||||
def self.rails6_and_up?
|
||||
Rails::VERSION::MAJOR >= 6
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user