Class: Workers::DeferredRetraction

Inherits:
Base
  • Object
show all
Defined in:
app/workers/deferred_retraction.rb

Instance Method Summary collapse

Instance Method Details

#perform(user_id, retraction_class, retraction_data, recipient_ids, opts) ⇒ Object


11
12
13
14
15
16
17
18
# File 'app/workers/deferred_retraction.rb', line 11

def perform(user_id, retraction_class, retraction_data, recipient_ids, opts)
  user = User.find(user_id)
  subscribers = Person.where(id: recipient_ids)
  object = retraction_class.constantize.new(retraction_data.deep_symbolize_keys, subscribers)
  opts = ActiveSupport::HashWithIndifferentAccess.new(opts)

  Diaspora::Federation::Dispatcher.build(user, object, opts).dispatch
end