aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2019-02-21 14:35:09 -0800
committerXavier Noria <fxn@hashref.com>2019-02-21 14:51:28 -0800
commitb7fe3bddef690f4188905dd7f6f57e6a876d239c (patch)
tree39b38e484addff51eb3d1fe5656812d4068ed0e2 /railties
parentf2e51e31239e7c1ff9a92996a3e13b128095377c (diff)
downloadrails-b7fe3bddef690f4188905dd7f6f57e6a876d239c.tar.gz
rails-b7fe3bddef690f4188905dd7f6f57e6a876d239c.tar.bz2
rails-b7fe3bddef690f4188905dd7f6f57e6a876d239c.zip
simplifies Rails.autoloaders.logger=
Possible thanks to Zeitwerk 1.3.0.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/autoloaders.rb3
-rw-r--r--railties/test/application/zeitwerk_integration_test.rb4
2 files changed, 3 insertions, 4 deletions
diff --git a/railties/lib/rails/autoloaders.rb b/railties/lib/rails/autoloaders.rb
index 4b41e1faf9..a6974cc207 100644
--- a/railties/lib/rails/autoloaders.rb
+++ b/railties/lib/rails/autoloaders.rb
@@ -25,8 +25,7 @@ module Rails
end
def logger=(logger)
- callable_or_nil = logger.respond_to?(:debug) ? logger.method(:debug) : logger
- each { |loader| loader.logger = callable_or_nil }
+ each { |loader| loader.logger = logger }
end
def zeitwerk_enabled?
diff --git a/railties/test/application/zeitwerk_integration_test.rb b/railties/test/application/zeitwerk_integration_test.rb
index c683b5cc5f..18e53f88b7 100644
--- a/railties/test/application/zeitwerk_integration_test.rb
+++ b/railties/test/application/zeitwerk_integration_test.rb
@@ -214,13 +214,13 @@ class ZeitwerkIntegrationTest < ActiveSupport::TestCase
Rails.autoloaders.logger = logger
Rails.autoloaders.each do |autoloader|
- assert_equal logger, autoloader.logger
+ assert_same logger, autoloader.logger
end
Rails.autoloaders.logger = Rails.logger
Rails.autoloaders.each do |autoloader|
- assert_equal Rails.logger.method(:debug), autoloader.logger
+ assert_same Rails.logger, autoloader.logger
end
Rails.autoloaders.logger = nil