module Digitalforce::Concerns::Account

Attributes

client[RW]

Public Instance Methods

manage_salesforce_account_creation() click to toggle source
# File lib/digitalforce/concerns/account.rb, line 30
def manage_salesforce_account_creation
  if self.new_record? && !self.s_id?
    @accountId = self.client.create('Account', Name: self.name)
    self.s_id = @accountId
  else
    self.client.update('Account', Id: self.s_id, Name: self.name)
  end
end
manage_salesforce_account_destroy() click to toggle source
# File lib/digitalforce/concerns/account.rb, line 39
def manage_salesforce_account_destroy
  if self.s_id
    self.client.destroy('Account', self.s_id)
  end
end