Module: Crm::Core::Mixins::Modifiable
- Extended by:
- ActiveSupport::Concern, ClassMethods
- Included in:
- Account, Activity, Crm::Collection, Crm::Contact, Event, EventContact, Mailing, Type
- Defined in:
- lib/crm/core/mixins/modifiable.rb
Overview
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#delete ⇒ self
(also: #destroy)
Soft-deletes this item (i.e. marks it as deleted).
-
#deleted? ⇒ Boolean
Returns
true
if the item was deleted (i.e.item.deleted_at
is not empty). -
#undelete ⇒ self
Undeletes this deleted item.
-
#update(attributes = {}) ⇒ self
Updates the attributes of this item.
Methods included from ClassMethods
Instance Method Details
#delete ⇒ self Also known as: destroy
Soft-deletes this item (i.e. marks it as deleted).
The deleted item can be undeleted.
73 74 75 |
# File 'lib/crm/core/mixins/modifiable.rb', line 73 def delete load_attributes(RestApi.instance.delete(path, nil, if_match_header)) end |
#deleted? ⇒ Boolean
Returns true
if the item was deleted (i.e. item.deleted_at
is not empty).
96 97 98 |
# File 'lib/crm/core/mixins/modifiable.rb', line 96 def deleted? self['deleted_at'].present? end |