Class: Workers::NotifyLocalUsers

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

Instance Method Summary collapse

Methods inherited from Base

#suppress_annoying_errors

Instance Method Details

#perform(user_ids, object_klass, object_id, person_id) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/workers/notify_local_users.rb', line 9

def perform(user_ids, object_klass, object_id, person_id)

  object = object_klass.constantize.find_by_id(object_id)

  #hax
  return if (object.author.diaspora_handle == '[email protected]' || (object.respond_to?(:relayable?) && object.parent.author.diaspora_handle == '[email protected]'))
  #end hax

  users = User.where(:id => user_ids)
  person = Person.find_by_id(person_id)

  users.find_each{|user| Notification.notify(user, object, person) }
end