From 3008188cd6c0cca8789e8b7c57a4f896e2ff07d5 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 24 Feb 2012 16:35:48 -0800 Subject: consistently mention first patch, then put There was a mix, sometimes patch first, sometimes put first. Use always patch first, since this is going to be the primary verb for updates. --- activeresource/lib/active_resource/custom_methods.rb | 2 +- activeresource/lib/active_resource/http_mock.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'activeresource') diff --git a/activeresource/lib/active_resource/custom_methods.rb b/activeresource/lib/active_resource/custom_methods.rb index 095dcd2a8e..839dc79d50 100644 --- a/activeresource/lib/active_resource/custom_methods.rb +++ b/activeresource/lib/active_resource/custom_methods.rb @@ -12,7 +12,7 @@ module ActiveResource # This route set creates routes for the following HTTP requests: # # POST /people/new/register.json # PeopleController.register - # PUT/PATCH /people/1/promote.json # PeopleController.promote with :id => 1 + # PATCH/PUT /people/1/promote.json # PeopleController.promote with :id => 1 # DELETE /people/1/deactivate.json # PeopleController.deactivate with :id => 1 # GET /people/active.json # PeopleController.active # diff --git a/activeresource/lib/active_resource/http_mock.rb b/activeresource/lib/active_resource/http_mock.rb index 820b178d4b..9856f5872f 100644 --- a/activeresource/lib/active_resource/http_mock.rb +++ b/activeresource/lib/active_resource/http_mock.rb @@ -55,7 +55,7 @@ module ActiveResource @responses = responses end - [ :post, :put, :patch, :get, :delete, :head ].each do |method| + [ :post, :patch, :put, :get, :delete, :head ].each do |method| # def post(path, request_headers = {}, body = nil, status = 200, response_headers = {}) # @responses[Request.new(:post, path, nil, request_headers)] = Response.new(body || "", status, response_headers) # end @@ -291,9 +291,9 @@ module ActiveResource if resp_cls && !resp_cls.body_permitted? @body = nil end - + self['Content-Length'] = @body.nil? ? "0" : body.size.to_s - + end # Returns true if code is 2xx, -- cgit v1.2.3