diff options
-rw-r--r-- | activesupport/lib/active_support/deprecation.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb index 8cfb37a9bc..581d131c3a 100644 --- a/activesupport/lib/active_support/deprecation.rb +++ b/activesupport/lib/active_support/deprecation.rb @@ -9,11 +9,15 @@ module ActiveSupport class << self def warn(message = nil, callstack = caller) - behavior.call(deprecation_message(callstack, message)) if behavior && ! silenced? + behavior.call(deprecation_message(callstack, message)) if behavior && !silenced? end def default_behavior - DEFAULT_BEHAVIORS[RAILS_ENV.to_s] if defined?(RAILS_ENV) + if defined?(RAILS_ENV) + DEFAULT_BEHAVIORS[RAILS_ENV.to_s] + else + DEFAULT_BEHAVIORS['test'] + end end # Have deprecations been silenced? |