class Restforce::Client
def upsert!(sobject, field, attrs)
Returns the Id of the newly created record if the record was created.
Returns true if the record was found and updated.
See .upsert
def upsert!(sobject, field, attrs) external_id = attrs.has_key?(field.to_sym) ? attrs.delete(field.to_sym) : attrs.delete(field.to_s) response = api_patch "sobjects/#{sobject}/#{field.to_s}/#{external_id}", attrs (response.body && response.body['id']) ? response.body['id'] : true end