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

Changeset 8334

Show
Ignore:
Timestamp:
12/08/07 19:23:03 (9 months ago)
Author:
rick
Message:

Clean up some cruft around ActionController::Base#head. Closes #10417 [ssoroka]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r8330 r8334  
     1*SVN* 
     2 
     3* Clean up some cruft around ActionController::Base#head.  Closes #10417 [ssoroka] 
     4 
    15*2.0.1* (December 7th, 2007) 
    26 
  • trunk/actionpack/lib/action_controller/base.rb

    r8316 r8334  
    944944        elsif args.empty? 
    945945          raise ArgumentError, "too few arguments to head" 
    946         elsif args.length == 2 
    947           status = args.shift 
    948           options = args.shift 
    949         elsif args.first.is_a?(Hash) 
    950           options = args.first 
    951         else 
    952           status = args.first 
    953           options = {} 
    954         end 
    955  
    956         raise ArgumentError, "head requires an options hash" if !options.is_a?(Hash) 
    957  
    958         status = interpret_status(status || options.delete(:status) || :ok) 
     946        end 
     947        options = args.extract_options! 
     948        status = interpret_status(args.shift || options.delete(:status) || :ok) 
    959949 
    960950        options.each do |key, value|