This project is archived and is in readonly mode.

#1717 new
Matthew Moore

ActiveResource::CustomMethods#put should behave like #post for body encoding

Reported by Matthew Moore | January 9th, 2009 @ 09:27 AM | in 3.x

If you compare the two methods in ActiveResrouce::CustomMethods, you see:



      def post(method_name, options = {}, body = nil)
        request_body = body.blank? ? encode : body
        if new?
          connection.post(custom_method_new_element_url(method_name, options), request_body, self.class.headers)
        else
          connection.post(custom_method_element_url(method_name, options), request_body, self.class.headers)
        end
      end

      def put(method_name, options = {}, body = '')
        connection.put(custom_method_element_url(method_name, options), body, self.class.headers)
      end

I can't figure out for the life of me why the post method has


request_body = body.blank? ? encode : body

but put doesn't.

Should I add that line to put?

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages