aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-22 01:16:09 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-22 01:16:09 +0000
commit75545186659ba8f23975497d8ce2ae1e7b9c09b9 (patch)
treea3825550b74fa2f5cf1d1030c76193934b01caf9 /activesupport/lib
parent0b61be466678233fbd693d44a4fae15adb6d925b (diff)
downloadrails-75545186659ba8f23975497d8ce2ae1e7b9c09b9.tar.gz
rails-75545186659ba8f23975497d8ce2ae1e7b9c09b9.tar.bz2
rails-75545186659ba8f23975497d8ce2ae1e7b9c09b9.zip
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
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/deprecation.rb10
1 files changed, 9 insertions, 1 deletions
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