aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-04 00:17:01 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-04 00:17:01 +0000
commit29cec6d0ab540263ac25c906c9ccfd5fb3a389cc (patch)
tree39ed83643c8ee7e0a79eeda741207bd72dc18ad9 /activesupport
parent528618a91082748133488fefbf5f57cf8b96ed75 (diff)
downloadrails-29cec6d0ab540263ac25c906c9ccfd5fb3a389cc.tar.gz
rails-29cec6d0ab540263ac25c906c9ccfd5fb3a389cc.tar.bz2
rails-29cec6d0ab540263ac25c906c9ccfd5fb3a389cc.zip
get deprecation methods and callers straight
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4959 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/deprecation.rb6
-rw-r--r--activesupport/test/deprecation_test.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb
index f4d4559f84..c61dd73076 100644
--- a/activesupport/lib/active_support/deprecation.rb
+++ b/activesupport/lib/active_support/deprecation.rb
@@ -38,8 +38,8 @@ module ActiveSupport
private
def deprecation_message(callstack, message = nil)
file, line, method = extract_callstack(callstack)
- message ||= "#{method} is deprecated and will be removed from Rails 2.0."
- "DEPRECATION WARNING: #{message}. See http://www.rubyonrails.org/deprecation for details. (#{method} at #{file}:#{line})"
+ message ||= "You are using deprecated behavior which will be removed from Rails 2.0."
+ "DEPRECATION WARNING: #{message} See http://www.rubyonrails.org/deprecation for details. (called from #{method} at #{file}:#{line})"
end
def extract_callstack(callstack)
@@ -57,7 +57,7 @@ module ActiveSupport
method_names.each do |method_name|
class_eval(<<-EOS, __FILE__, __LINE__)
def #{method_name}_with_deprecation(*args, &block)
- ::ActiveSupport::Deprecation.warn
+ ::ActiveSupport::Deprecation.warn("#{method_name} is deprecated and will be removed from Rails 2.0", caller)
#{method_name}_without_deprecation(*args, &block)
end
EOS
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb
index 7c5cb5783c..75a0d38f5b 100644
--- a/activesupport/test/deprecation_test.rb
+++ b/activesupport/test/deprecation_test.rb
@@ -47,7 +47,7 @@ class DeprecationTest < Test::Unit::TestCase
end
def test_deprecate_class_method
- assert_deprecated(/none is deprecated/) do
+ assert_deprecated(/none is deprecated.*test_deprecate_class_method at/) do
assert_equal 1, @dtc.none
end