diff options
author | Xavier Noria <fxn@hashref.com> | 2019-02-15 14:47:16 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2019-02-15 14:49:44 -0800 |
commit | 3aa3c0684d3bd748be9e85d25616a8a7a1ab7755 (patch) | |
tree | 90db5bb0029ee5e2d2400a6fb7a6019cfd67ada5 /activesupport/lib/active_support/dependencies/zeitwerk_integration.rb | |
parent | a25282ed1e43ea04556c9243b5dc4d62517f43ef (diff) | |
download | rails-3aa3c0684d3bd748be9e85d25616a8a7a1ab7755.tar.gz rails-3aa3c0684d3bd748be9e85d25616a8a7a1ab7755.tar.bz2 rails-3aa3c0684d3bd748be9e85d25616a8a7a1ab7755.zip |
Implement AS::Dependencies.verbose= compatibility for :zeitwerk mode
Diffstat (limited to 'activesupport/lib/active_support/dependencies/zeitwerk_integration.rb')
-rw-r--r-- | activesupport/lib/active_support/dependencies/zeitwerk_integration.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/dependencies/zeitwerk_integration.rb b/activesupport/lib/active_support/dependencies/zeitwerk_integration.rb index 55fc92ee8b..23c237796e 100644 --- a/activesupport/lib/active_support/dependencies/zeitwerk_integration.rb +++ b/activesupport/lib/active_support/dependencies/zeitwerk_integration.rb @@ -26,6 +26,11 @@ module ActiveSupport cpath = object.is_a?(Module) ? object.name : object.to_s Rails.autoloaders.any? { |autoloader| autoloader.loaded?(cpath) } end + + def verbose=(verbose) + l = verbose ? (logger || Rails.logger).method(:debug) : nil + Rails.autoloaders.each { |autoloader| autoloader.logger = l } + end end class << self |