From 75545186659ba8f23975497d8ce2ae1e7b9c09b9 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 22 Sep 2006 01:16:09 +0000 Subject: [PATCH] deprecation_method_warning and deprecation_horizon - fewer moving parts, easy to localize git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5161 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/deprecation.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb index 50aff7582d..297a17850e 100644 --- a/activesupport/lib/active_support/deprecation.rb +++ b/activesupport/lib/active_support/deprecation.rb @@ -75,13 +75,21 @@ module ActiveSupport alias_method_chain(method_name, :deprecation) do |target, punctuation| class_eval(<<-EOS, __FILE__, __LINE__) def #{target}_with_deprecation#{punctuation}(*args, &block) - ::ActiveSupport::Deprecation.warn("#{method_name} is deprecated and will be removed from Rails 2.0", caller) + ::ActiveSupport::Deprecation.warn(self.class.deprecated_method_warning(:#{method_name}), caller) #{target}_without_deprecation#{punctuation}(*args, &block) end EOS end end end + + def deprecated_method_warning(method_name) + "#{method_name} is deprecated and will be removed from Rails #{deprecation_horizon}" + end + + def deprecation_horizon + '2.0' + end end module Assertions