Class: Workers::ReceiveLocal

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

Instance Method Summary collapse

Instance Method Details

#perform(object_class_string, object_id, recipient_user_ids) ⇒ Object


7
8
9
10
11
12
13
14
# File 'app/workers/receive_local.rb', line 7

def perform(object_class_string, object_id, recipient_user_ids)
  object = object_class_string.constantize.find(object_id)

  object.receive(recipient_user_ids) if object.respond_to?(:receive)

  NotificationService.new.notify(object, recipient_user_ids)
rescue ActiveRecord::RecordNotFound # Already deleted before the job could run
end