28 lines
479 B
Ruby
28 lines
479 B
Ruby
class Participation < Federated::Relayable
|
|
class Generator < Federated::Generator
|
|
def self.federated_class
|
|
Participation
|
|
end
|
|
|
|
def relayable_options
|
|
{:target => @target}
|
|
end
|
|
end
|
|
|
|
def unparticipate!
|
|
if count == 1
|
|
destroy
|
|
else
|
|
update!(count: count.pred)
|
|
end
|
|
end
|
|
|
|
# NOTE API V1 to be extracted
|
|
acts_as_api
|
|
api_accessible :backbone do |t|
|
|
t.add :id
|
|
t.add :guid
|
|
t.add :author
|
|
t.add :created_at
|
|
end
|
|
end
|