Class: PipeLineDealer::Person

Inherits:
Model::Base show all
Defined in:
lib/pipe_line_dealer/model/person.rb,
lib/pipe_line_dealer/model/person/custom_field.rb

Defined Under Namespace

Classes: CustomField

Constant Summary

Constants included from Model::Base::Concern::Persistance

Model::Base::Concern::Persistance::IGNORE_ATTRIBUTES_WHEN_SAVING

Instance Attribute Summary

Attributes inherited from Model::Base

#attributes, #id

Instance Method Summary collapse

Methods inherited from Model::Base

#==, #attributes_for_saving, attrs, inherited, #initialize, pld_attr, #to_json, #to_s

Methods included from Model::Base::Concern::Persistance

#destroy, #new_record?, #persisted?, #save

Constructor Details

This class inherits a constructor from PipeLineDealer::Model::Base

Instance Method Details

#attributes_for_saving_with_person(attributes) ⇒ Object

TODO: make sure that removeing one of these causes problems.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/pipe_line_dealer/model/person.rb', line 16

def attributes_for_saving_with_person attributes
  attributes = attributes_for_saving_without_person(attributes)

  attributes.delete(:company)
  attributes.delete(:deals)
  attributes.delete(:won_deals_total)
  attributes.delete(:lead_status)
  attributes.delete(:viewed_at)
  attributes.delete(:deal_ids)
  attributes.delete(:predefined_contacts_tag_ids)
  attributes.delete(:user_id)
  attributes.delete(:user)

  attributes.delete(:image_thumb_url) if attributes[:image_thumb_url] == "/images/thumb/missing.png"

  attributes
end

#process_attributesObject



11
12
13
# File 'lib/pipe_line_dealer/model/person.rb', line 11

def process_attributes
  @attributes.delete(:custom_fields)
end