From 237272e049e409c9f620dfadb7cf0688e8c91b0f Mon Sep 17 00:00:00 2001 From: Travis Pew Date: Mon, 28 Nov 2011 15:46:09 -0500 Subject: Fix ActionDispatch::Request method explanations The methods, "post?", "put?", "head?", etc. contain an incorrect explanation. They state that they are equivalent to request_method == :type, but this is not accurate because the methods convert the string to a symbol. They are actually equivalent to: request_method_symbol == :type --- actionpack/lib/action_dispatch/http/request.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_dispatch/http') diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 69ca050d0c..e86dfd64d2 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -94,31 +94,31 @@ module ActionDispatch end # Is this a GET (or HEAD) request? - # Equivalent to request.request_method == :get. + # Equivalent to request.request_method_symbol == :get. def get? HTTP_METHOD_LOOKUP[request_method] == :get end # Is this a POST request? - # Equivalent to request.request_method == :post. + # Equivalent to request.request_method_symbol == :post. def post? HTTP_METHOD_LOOKUP[request_method] == :post end # Is this a PUT request? - # Equivalent to request.request_method == :put. + # Equivalent to request.request_method_symbol == :put. def put? HTTP_METHOD_LOOKUP[request_method] == :put end # Is this a DELETE request? - # Equivalent to request.request_method == :delete. + # Equivalent to request.request_method_symbol == :delete. def delete? HTTP_METHOD_LOOKUP[request_method] == :delete end # Is this a HEAD request? - # Equivalent to request.method == :head. + # Equivalent to request.method_symbol == :head. def head? HTTP_METHOD_LOOKUP[method] == :head end -- cgit v1.2.3