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

Changeset 4959

Show
Ignore:
Timestamp:
09/04/06 00:17:01 (2 years ago)
Author:
bitsweat
Message:

get deprecation methods and callers straight

Files:

Legend:

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

    r4952 r4959  
    3939        def deprecation_message(callstack, message = nil) 
    4040          file, line, method = extract_callstack(callstack) 
    41           message ||= "#{method} is deprecated and will be removed from Rails 2.0." 
    42           "DEPRECATION WARNING: #{message}. See http://www.rubyonrails.org/deprecation for details. (#{method} at #{file}:#{line})" 
     41          message ||= "You are using deprecated behavior which will be removed from Rails 2.0." 
     42          "DEPRECATION WARNING: #{message}  See http://www.rubyonrails.org/deprecation for details. (called from #{method} at #{file}:#{line})" 
    4343        end 
    4444 
     
    5858          class_eval(<<-EOS, __FILE__, __LINE__) 
    5959            def #{method_name}_with_deprecation(*args, &block) 
    60               ::ActiveSupport::Deprecation.warn 
     60              ::ActiveSupport::Deprecation.warn("#{method_name} is deprecated and will be removed from Rails 2.0", caller) 
    6161              #{method_name}_without_deprecation(*args, &block) 
    6262            end 
  • trunk/activesupport/test/deprecation_test.rb

    r4760 r4959  
    4848 
    4949  def test_deprecate_class_method 
    50     assert_deprecated(/none is deprecated/) do 
     50    assert_deprecated(/none is deprecated.*test_deprecate_class_method at/) do 
    5151      assert_equal 1, @dtc.none 
    5252    end