Class: Socializer::Circle

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ObjectTypeBase
Defined in:
app/models/socializer/circle.rb

Instance Method Summary collapse

Methods included from ObjectTypeBase

#guid

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

#authorObject



14
15
16
# File 'app/models/socializer/circle.rb', line 14

def author
  @author ||= activity_author.activitable
end

#contactsObject



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