From eb90b94afdc4358793647b08d28e29af34d45ff8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Sep 2006 20:37:25 +0000 Subject: If not running in Rails, we will log deprecations to $stderr git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4939 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/deprecation.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'activesupport/lib') 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? -- cgit v1.2.3