From 26946e36e3876c68fb61a3aea4615e2327cfcd18 Mon Sep 17 00:00:00 2001 From: Ken Treis Date: Thu, 25 Jan 2024 14:56:58 -0800 Subject: [PATCH] spec: set logger to `nil` rather than `false` Beginning in ActiveSupport 7.1, the check for whether a logger is silenced sends `nil?`, so things break if we set the logger to `false`. Fortunately, using `nil` also works in older versions of ActiveSupport. --- spec/support/macros/database_macros.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/support/macros/database_macros.rb b/spec/support/macros/database_macros.rb index ebe2cdf..4d7cdfc 100644 --- a/spec/support/macros/database_macros.rb +++ b/spec/support/macros/database_macros.rb @@ -25,6 +25,7 @@ def setup_database(opts = {}) adapter.reset_database! # Silence everything - ActiveRecord::Base.logger = ActiveRecord::Migration.verbose = false + ActiveRecord::Base.logger = nil + ActiveRecord::Migration.verbose = false end end