Class: CapsuleCRM::CustomField

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Naming
Includes:
ActiveModel::Conversion, ActiveModel::Validations, Associations, Inspector, Querying::Configuration, Serializable
Defined in:
lib/capsule_crm/custom_field.rb

Instance Method Summary collapse

Methods included from Serializable

included, #serializer, #to_capsule_json

Methods included from Querying::Configuration

included

Methods included from Inspector

#inspect

Instance Method Details

#destroyObject



46
47
48
49
50
51
# File 'lib/capsule_crm/custom_field.rb', line 46

def destroy
  self.date, self.tag, self.boolean, self.text = nil, nil, nil, nil
  parent.custom_fields.save
  parent.custom_fields.delete_if { |cf| cf.id == id }
  true
end

#parentObject



42
43
44
# File 'lib/capsule_crm/custom_field.rb', line 42

def parent
  party || opportunity || self.case
end