Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

get deprecation methods and callers straight

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4959 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 29cec6d0ab540263ac25c906c9ccfd5fb3a389cc 1 parent 528618a
@jeremy jeremy authored
View
6 activesupport/lib/active_support/deprecation.rb
@@ -38,8 +38,8 @@ def silence
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 @@ def deprecate(*method_names)
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
View
2  activesupport/test/deprecation_test.rb
@@ -47,7 +47,7 @@ def test_undeprecated
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
Please sign in to comment.
Something went wrong with that request. Please try again.