Module: ErpBaseErpSvcs::Extensions::ActiveRecord::HasContact::InstanceMethods
- Defined in:
- lib/erp_base_erp_svcs/extensions/active_record/has_contact.rb
Instance Method Summary collapse
-
#contact_purpose_iids ⇒ Object
return all contact purpose iids in one comma separated string.
-
#contact_purposes ⇒ Object
return all contact purposes.
-
#contact_purposes_to_s ⇒ Object
return all contact purposes in one comma separated string.
- #destroy_contact ⇒ Object
- #initialize_contact ⇒ Object
- #save_contact ⇒ Object
Instance Method Details
#contact_purpose_iids ⇒ Object
return all contact purpose iids in one comma separated string
44 45 46 |
# File 'lib/erp_base_erp_svcs/extensions/active_record/has_contact.rb', line 44 def contact_purpose_iids contact.contact_purposes.collect(&:internal_identifier).join(',') end |
#contact_purposes ⇒ Object
return all contact purposes
49 50 51 |
# File 'lib/erp_base_erp_svcs/extensions/active_record/has_contact.rb', line 49 def contact_purposes contact.contact_purposes end |
#contact_purposes_to_s ⇒ Object
return all contact purposes in one comma separated string
39 40 41 |
# File 'lib/erp_base_erp_svcs/extensions/active_record/has_contact.rb', line 39 def contact_purposes_to_s contact.contact_purposes.collect(&:description).join(', ') end |
#destroy_contact ⇒ Object
53 54 55 |
# File 'lib/erp_base_erp_svcs/extensions/active_record/has_contact.rb', line 53 def destroy_contact self.contact.destroy unless self.contact.nil? end |
#initialize_contact ⇒ Object
57 58 59 60 61 62 |
# File 'lib/erp_base_erp_svcs/extensions/active_record/has_contact.rb', line 57 def initialize_contact if self.new_record? and self.contact.nil? self.contact = Contact.new self.contact.description = self.description end end |
#save_contact ⇒ Object
34 35 36 |
# File 'lib/erp_base_erp_svcs/extensions/active_record/has_contact.rb', line 34 def save_contact self.contact.save end |