diaspora/app/models/jobs/notify_local_users.rb
2011-11-04 18:46:43 -07:00

20 lines
612 B
Ruby

# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
module Jobs
class NotifyLocalUsers < Base
@queue = :receive_local
require File.join(Rails.root, 'app/models/notification')
def self.perform(user_ids, object_klass, object_id, person_id)
object = object_klass.constantize.find_by_id(object_id)
users = object.participant_users
person = Person.find_by_id(person_id)
users.each do |user|
Notification.notify(user, object, person)
end
end
end
end