lib/parse/push.rb in parse-ruby-client-0.0.6 vs lib/parse/push.rb in parse-ruby-client-0.0.7

- old
+ new

@@ -17,13 +17,18 @@ def save uri = Protocol.push_uri body = { :data => @data, :channel => @channel } - body.merge({ :channels => @channels }) if @channels - body.merge({ :expiration_time_interval => @expiration_time_interval }) if @expiration_time_interval - body.merge({ :expiration_time => @expiration_time }) if @expiration_time - body.merge({ :type => @type }) if @type + + if @channels + body.merge!({ :channels => @channels }) + body.delete :channel + end + + body.merge!({ :expiration_time_interval => @expiration_time_interval }) if @expiration_time_interval + body.merge!({ :expiration_time => @expiration_time }) if @expiration_time + body.merge!({ :type => @type }) if @type response = Parse.client.request uri, :post, body.to_json, nil end end \ No newline at end of file