diff options
author | Nikita Afanasenko <nikita@afanasenko.name> | 2012-10-29 19:22:59 +0400 |
---|---|---|
committer | Nikita Afanasenko <nikita@afanasenko.name> | 2012-10-29 19:22:59 +0400 |
commit | 0b7067d8497c4d832b32233888ce973ab4357e5d (patch) | |
tree | 036be2c4e07d30287498a8de215550330039a176 /activesupport/lib/active_support/test_case.rb | |
parent | 29b1dc273e1ad6b9e13bf48fe3f12047850f9554 (diff) | |
download | rails-0b7067d8497c4d832b32233888ce973ab4357e5d.tar.gz rails-0b7067d8497c4d832b32233888ce973ab4357e5d.tar.bz2 rails-0b7067d8497c4d832b32233888ce973ab4357e5d.zip |
Provide a call stack for deprecation warnings where needed.
It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
Diffstat (limited to 'activesupport/lib/active_support/test_case.rb')
-rw-r--r-- | activesupport/lib/active_support/test_case.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index 81d97ecb40..646e70c29f 100644 --- a/activesupport/lib/active_support/test_case.rb +++ b/activesupport/lib/active_support/test_case.rb @@ -43,7 +43,8 @@ module ActiveSupport if block_given? super else - ActiveSupport::Deprecation.warn("`describe` without a block is deprecated, please switch to: `def self.name; #{text.inspect}; end`\n") + message = "`describe` without a block is deprecated, please switch to: `def self.name; #{text.inspect}; end`\n" + ActiveSupport::Deprecation.warn(message, caller) class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 def self.name |