diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/deprecation.rb | 10 |
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 |