Class: Watchtower::Contact
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Watchtower::Contact
- Defined in:
- app/models/watchtower/contact.rb
Defined Under Namespace
Modules: DataExtension
Instance Method Summary collapse
Instance Method Details
#full_name ⇒ Object
38 39 40 |
# File 'app/models/watchtower/contact.rb', line 38 def full_name [first_name, middle_name, last_name].compact.join(' ') end |
#name ⇒ Object
42 43 44 |
# File 'app/models/watchtower/contact.rb', line 42 def name full_name end |
#tag_names ⇒ Object
23 24 25 |
# File 'app/models/watchtower/contact.rb', line 23 def tag_names .map(&:to_s) end |
#tag_with(tag_name) ⇒ Object
50 51 52 |
# File 'app/models/watchtower/contact.rb', line 50 def tag_with(tag_name) taggings.create(tag: Tag.find_or_create_by_name(tag_name.try(:downcase))) end |
#to_s ⇒ Object
46 47 48 |
# File 'app/models/watchtower/contact.rb', line 46 def to_s full_name end |