Class: Activity::ModelCollectedJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/activity/model_collected_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(model_id, collection_id) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'app/jobs/activity/model_collected_job.rb', line 5

def perform(model_id, collection_id)
  model = Model.find(model_id)
  collection = model.collections.find(collection_id)
  # Make sure the model is still in the collection, this could be later on
  return unless collection
  # Boost the new model and its creation comment to the collection's followers
  model.federails_actor.announce! actor: collection.federails_actor
  model.creation_comment.announce! actor: collection.federails_actor
end