diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-09-03 20:37:25 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-09-03 20:37:25 +0000 |
commit | eb90b94afdc4358793647b08d28e29af34d45ff8 (patch) | |
tree | 79026d975c20761155f93f4e146e166d9ca0d120 | |
parent | 761f1f1f3a3ecbcc4f4c7b7ebc0f1315a0c96c90 (diff) | |
download | rails-eb90b94afdc4358793647b08d28e29af34d45ff8.tar.gz rails-eb90b94afdc4358793647b08d28e29af34d45ff8.tar.bz2 rails-eb90b94afdc4358793647b08d28e29af34d45ff8.zip |
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
-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? |