Class: Socializer::Circle
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Socializer::Circle
- Includes:
- ObjectTypeBase
- Defined in:
- app/models/socializer/circle.rb
Instance Method Summary collapse
- #add_contact(contact_id) ⇒ Object
- #author ⇒ Object
- #contacts ⇒ Object
- #remove_contact(contact_id) ⇒ Object
Methods included from ObjectTypeBase
Instance Method Details
#add_contact(contact_id) ⇒ Object
22 23 24 25 |
# File 'app/models/socializer/circle.rb', line 22 def add_contact(contact_id) @tie = ties.build(contact_id: contact_id) @tie.save end |
#author ⇒ Object
14 15 16 |
# File 'app/models/socializer/circle.rb', line 14 def @author ||= .activitable end |
#contacts ⇒ Object
18 19 20 |
# File 'app/models/socializer/circle.rb', line 18 def contacts @contacts ||= activity_contacts.map { |ec| ec.activitable } end |
#remove_contact(contact_id) ⇒ Object
27 28 29 30 |
# File 'app/models/socializer/circle.rb', line 27 def remove_contact(contact_id) @tie = ties.find_by(contact_id: contact_id) @tie.destroy end |