From dffc2e2b64c89fdb0303bd18eccc7351ed0a0a58 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 30 Oct 2008 12:47:23 +0100 Subject: Fixed that ActiveResource#post would post an empty string when it shouldn't be posting anything (Paolo Angelini) [#525 state:committed] --- activeresource/lib/active_resource/custom_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activeresource/lib/active_resource') diff --git a/activeresource/lib/active_resource/custom_methods.rb b/activeresource/lib/active_resource/custom_methods.rb index 24306f251d..4647e8342c 100644 --- a/activeresource/lib/active_resource/custom_methods.rb +++ b/activeresource/lib/active_resource/custom_methods.rb @@ -90,7 +90,7 @@ module ActiveResource end def post(method_name, options = {}, body = nil) - request_body = body.nil? ? encode : body + request_body = body.blank? ? encode : body if new? connection.post(custom_method_new_element_url(method_name, options), request_body, self.class.headers) else -- cgit v1.2.3