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

Changeset 7436

Show
Ignore:
Timestamp:
09/09/07 23:00:17 (2 years ago)
Author:
david
Message:

Removed deprecated form of calling xml_http_request/xhr without the first argument being the http verb [DHH]

Files:

Legend:

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

    r7434 r7436  
    11*SVN* 
     2 
     3* Removed deprecated form of calling xml_http_request/xhr without the first argument being the http verb [DHH] 
    24 
    35* Removed deprecated methods [DHH]: 
  • trunk/actionpack/lib/action_controller/integration.rb

    r7421 r7436  
    184184      # the headers are a hash.  Keys are automatically upcased and prefixed 
    185185      # with 'HTTP_' if not already. 
    186       # 
    187       # This method used to omit the request_method parameter, assuming it 
    188       # was :post. This was deprecated in Rails 1.2.4. Always pass the request 
    189       # method as the first argument. 
    190186      def xml_http_request(request_method, path, parameters = nil, headers = nil) 
    191         unless request_method.is_a?(Symbol) 
    192           ActiveSupport::Deprecation.warn 'xml_http_request now takes the request_method (:get, :post, etc.) as the first argument. It used to assume :post, so add the :post argument to your existing method calls to silence this warning.' 
    193           request_method, path, parameters, headers = :post, request_method, path, parameters 
    194         end 
    195  
    196187        headers ||= {} 
    197188        headers['X-Requested-With'] = 'XMLHttpRequest' 
  • trunk/actionpack/test/controller/integration_test.rb

    r7010 r7436  
    131131  end 
    132132 
    133   def test_xml_http_request_deprecated_call 
    134     path = "/index"; params = "blah"; headers = {:location => 'blah'} 
    135     headers_after_xhr = headers.merge( 
    136       "X-Requested-With" => "XMLHttpRequest", 
    137       "Accept"           => "text/javascript, text/html, application/xml, text/xml, */*" 
    138     ) 
    139     @session.expects(:process).with(:post,path,params,headers_after_xhr) 
    140     assert_deprecated { @session.xml_http_request(path,params,headers) } 
    141   end 
    142  
    143133  def test_xml_http_request_get 
    144134    path = "/index"; params = "blah"; headers = {:location => 'blah'}