Class: Restforce::SObject

Inherits:
Object
  • Object
show all
Defined in:
lib/restforce/extensions.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#update!(attributes) ⇒ Object

Public: Update the Salesforce record with the passed attributes.

attributes - A Hash of attributes to assign to the record.

Raises on update error.



29
30
31
32
33
34
35
36
# File 'lib/restforce/extensions.rb', line 29

def update!(attributes)
  ensure_id
  response = @client.api_patch("sobjects/#{sobject_type}/#{self.Id}", attributes)
  update_time = response.env.response_headers["date"]

  merge!(attributes)
  merge!("SystemModstamp" => update_time)
end