module Digitalforce::Concerns::Contact

Attributes

client[RW]

Public Instance Methods

manage_salesforce_contact_creation() click to toggle source
# File lib/digitalforce/concerns/contact.rb, line 30
def manage_salesforce_contact_creation
  if self.new_record? && !self.s_id?
      @userId = self.client.create('Contact', FirstName: self.name, LastName: self.last_name, AccountId: self.account_id, Email: self.email, Phone: self.phone)
      self.s_id = @userId
  else
    self.client.update('Contact', Id: self.s_id, FirstName: self.name, LastName: self.last_name, AccountId: self.account_id, Email: self.email, Phone: self.phone)
  end
end
manage_salesforce_contact_destroy() click to toggle source
# File lib/digitalforce/concerns/contact.rb, line 39
def manage_salesforce_contact_destroy
  if self.s_id?
    self.client.destroy('Contact', self.s_id)
  end
end