diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 00:45:09 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 00:45:09 -0300 |
commit | 7c6861b0bc85077ed1f1dcb4a919de0f1b8d490d (patch) | |
tree | 8f7319a922ff5124985f11e6908afdadbe32f8d1 /activesupport/lib | |
parent | 8a1c3476a62005e3cb7cfe440da71b94fab8aa5b (diff) | |
download | rails-7c6861b0bc85077ed1f1dcb4a919de0f1b8d490d.tar.gz rails-7c6861b0bc85077ed1f1dcb4a919de0f1b8d490d.tar.bz2 rails-7c6861b0bc85077ed1f1dcb4a919de0f1b8d490d.zip |
Do not check only for the Rails constant
This constant may be define for auxiliar gems like rails-html-sanitizer
and these methods call will fail.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/kernel/debugger.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/deprecation/behaviors.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/kernel/debugger.rb b/activesupport/lib/active_support/core_ext/kernel/debugger.rb index d8bb461010..ddf66b2022 100644 --- a/activesupport/lib/active_support/core_ext/kernel/debugger.rb +++ b/activesupport/lib/active_support/core_ext/kernel/debugger.rb @@ -3,7 +3,7 @@ module Kernel # Starts a debugging session if the +debugger+ gem has been loaded (call rails server --debugger to load it). def debugger message = "\n***** Debugger requested, but was not available (ensure the debugger gem is listed in Gemfile/installed as gem): Start server with --debugger to enable *****\n" - defined?(Rails) ? Rails.logger.info(message) : $stderr.puts(message) + defined?(Rails.logger) ? Rails.logger.info(message) : $stderr.puts(message) end alias breakpoint debugger unless respond_to?(:breakpoint) end diff --git a/activesupport/lib/active_support/deprecation/behaviors.rb b/activesupport/lib/active_support/deprecation/behaviors.rb index 328b8c320a..9f9dca8453 100644 --- a/activesupport/lib/active_support/deprecation/behaviors.rb +++ b/activesupport/lib/active_support/deprecation/behaviors.rb @@ -20,7 +20,7 @@ module ActiveSupport log: ->(message, callstack) { logger = - if defined?(Rails) && Rails.logger + if defined?(Rails.logger) && Rails.logger Rails.logger else require 'active_support/logger' |