Class: Participation

Inherits:
ApplicationRecord show all
Includes:
Diaspora::Federated::Base, Diaspora::Fields::Author, Diaspora::Fields::Guid, Diaspora::Fields::Target
Defined in:
app/models/participation.rb

Defined Under Namespace

Classes: Generator

Instance Method Summary collapse

Methods included from Diaspora::Fields::Target

included

Methods included from Diaspora::Fields::Author

included

Methods included from Diaspora::Fields::Guid

included, #set_guid

Methods included from Diaspora::Federated::Base

#object_to_receive

Instance Method Details

#subscribersArray<Person>

Returns:


28
29
30
# File 'app/models/participation.rb', line 28

def subscribers
  [target.author]
end

#unparticipate!Object


19
20
21
22
23
24
25
# File 'app/models/participation.rb', line 19

def unparticipate!
  if count == 1
    destroy
  else
    update!(count: count.pred)
  end
end