Module: Crm::Core::Mixins::MergeAndDeletable

Included in:
Account, Crm::Contact
Defined in:
lib/crm/core/mixins/merge_and_deletable.rb

Overview

MergeAndDeletable provides the common #merge_and_delete method for accounts and contacts.

Instance Method Summary collapse

Instance Method Details

#merge_and_delete(merge_into_id) ⇒ self

Assigns the items associated with this item to the account or contact whose ID is merge_into_id. Afterwards, the current item is deleted.

Parameters:

  • merge_into_id (String)

    the ID of the account or contact to which the associated items are assigned.

Returns:

  • (self)

    the deleted item.



12
13
14
15
# File 'lib/crm/core/mixins/merge_and_deletable.rb', line 12

def merge_and_delete(merge_into_id)
  load_attributes(
      RestApi.instance.post("#{path}/merge_and_delete", {"merge_into_id" => merge_into_id}))
end