Changeset 4947
- Timestamp:
- 09/03/06 23:02:56 (2 years ago)
- Files:
-
- trunk/actionpack/lib/action_controller/base.rb (modified) (2 diffs)
- trunk/actionpack/Rakefile (modified) (1 diff)
- trunk/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/base.rb
r4945 r4947 491 491 when Symbol 492 492 ActiveSupport::Deprecation.warn( 493 "WARNING: You called url_for(:#{options}), which is a deprecated API . Instead you should use the named " +493 "WARNING: You called url_for(:#{options}), which is a deprecated API call. Instead you should use the named " + 494 494 "route directly, like #{options}(). Using symbols and parameters with url_for will be removed from Rails 2.0." 495 495 ) … … 672 672 raise DoubleRenderError, "Can only render or redirect once per action" if performed? 673 673 674 # Backwards compatibility 675 unless options.is_a?(Hash) 676 if options == :update 677 options = {:update => true} 678 else 679 return render_file(options || default_template_name, deprecated_status, true) 674 if options.nil? 675 return render_file(default_template_name, deprecated_status, true) 676 else 677 # Backwards compatibility 678 unless options.is_a?(Hash) 679 if options == :update 680 options = { :update => true } 681 else 682 ActiveSupport::Deprecation.warn( 683 "WARNING: You called render('#{options}'), which is a deprecated API call. Instead you use " + 684 "render :file => #{options}. Calling render with just a string will be removed from Rails 2.0." 685 ) 686 687 return render_file(options, deprecated_status, true) 688 end 680 689 end 681 690 end trunk/actionpack/Rakefile
r4865 r4947 30 30 # make sure we include the controller tests (c*) first as on some systems 31 31 # this will not happen automatically and the tests (as a whole) will error 32 t.test_files=Dir.glob( "test/c*/* _test.rb" ) + Dir.glob( "test/[ft]*/*_test.rb" )32 t.test_files=Dir.glob( "test/c*/**/*_test.rb" ) + Dir.glob( "test/[ft]*/*_test.rb" ) 33 33 # t.pattern = 'test/*/*_test.rb' 34 34 t.verbose = true trunk/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb
r4943 r4947 8 8 9 9 def deprecated_render_parameters 10 # render ""10 render "fun/games/hello_world" 11 11 end 12 12 … … 17 17 def rescue_action(e) raise e end 18 18 end 19 20 Target.template_root = File.dirname(__FILE__) + "/../../fixtures" 19 21 20 22 def setup … … 28 30 get :deprecated_symbol_parameter_to_url_for 29 31 end 32 30 33 assert_redirected_to "http://example.com/superstars" 31 34 end 35 36 def test_deprecated_render_parameters 37 assert_deprecated("render('fun/games/hello_world')") do 38 get :deprecated_render_parameters 39 end 40 41 assert_equal "Living in a nested world", @response.body 42 end 32 43 end