diff --git a/lib/hubspot/company.rb b/lib/hubspot/company.rb index f1aa4887..5a30959d 100644 --- a/lib/hubspot/company.rb +++ b/lib/hubspot/company.rb @@ -133,21 +133,21 @@ def remove_contact(id, contact_id) true end - def batch_update(companies, opts = {}) - request = companies.map do |company| - # Use the specified options or update with the changes - changes = opts.empty? ? company.changes : opts - - unless changes.empty? - { - "objectId" => company.id, - "properties" => changes.map { |k, v| { "name" => k, "value" => v } } - } - end - end + def batch_update(request) + # request = companies.map do |company| + # # Use the specified options or update with the changes + # changes = opts.empty? ? company.changes : opts + + # unless changes.empty? + # { + # "objectId" => company.id, + # "properties" => changes.map { |k, v| { "name" => k, "value" => v } } + # } + # end + # end # Remove any objects without changes and return if there is nothing to update - request.compact! + request.compact return true if request.empty? Hubspot::Connection.post_json(