Permalink
Browse files

deprecation_method_warning and deprecation_horizon - fewer moving par…

…ts, easy to localize

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5161 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 0b61be4 commit 75545186659ba8f23975497d8ce2ae1e7b9c09b9 @jeremy jeremy committed Sep 22, 2006
Showing with 9 additions and 1 deletion.
  1. +9 −1 activesupport/lib/active_support/deprecation.rb
@@ -75,13 +75,21 @@ def deprecate(*method_names)
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

0 comments on commit 7554518

Please sign in to comment.