From f926429461149a221bed723edbf07e1c272ace47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Gomes?= Date: Fri, 15 Aug 2014 09:49:59 +0100 Subject: [PATCH] Fixing issue with service-style batches and requests with bodies --- lib/google/api_client/service/batch.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/google/api_client/service/batch.rb b/lib/google/api_client/service/batch.rb index 7a25776a3..7ba406e61 100644 --- a/lib/google/api_client/service/batch.rb +++ b/lib/google/api_client/service/batch.rb @@ -80,6 +80,13 @@ module Google :api_method => call.method, :parameters => call.parameters } + if call.respond_to? :body + if call.body.respond_to? :to_hash + base_call[:body_object] = call.body + else + base_call[:body] = call.body + end + end @base_batch.add(base_call) do |base_result| result = Google::APIClient::Service::BatchedCallResult.new( call, base_result)