Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5161

Show
Ignore:
Timestamp:
09/22/06 01:16:09 (2 years ago)
Author:
bitsweat
Message:

deprecation_method_warning and deprecation_horizon - fewer moving parts, easy to localize

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/lib/active_support/deprecation.rb

    r5115 r5161  
    7676            class_eval(<<-EOS, __FILE__, __LINE__) 
    7777              def #{target}_with_deprecation#{punctuation}(*args, &block) 
    78                 ::ActiveSupport::Deprecation.warn("#{method_name} is deprecated and will be removed from Rails 2.0", caller) 
     78                ::ActiveSupport::Deprecation.warn(self.class.deprecated_method_warning(:#{method_name}), caller) 
    7979                #{target}_without_deprecation#{punctuation}(*args, &block) 
    8080              end 
     
    8282          end 
    8383        end 
     84      end 
     85 
     86      def deprecated_method_warning(method_name) 
     87        "#{method_name} is deprecated and will be removed from Rails #{deprecation_horizon}" 
     88      end 
     89 
     90      def deprecation_horizon 
     91        '2.0' 
    8492      end 
    8593    end