Fixed notifiaction.

This commit is contained in:
Martin Edenhofer 2014-08-26 10:18:59 +02:00
parent 9ad5ebf0d3
commit 8cdcea5f63
2 changed files with 4 additions and 3 deletions

View file

@ -177,6 +177,7 @@ class Observer::Ticket::Notification < ActiveRecord::Observer
params = {
:ticket_id => ticket.id,
:article_id => article.id,
:type => type,
:data => data,
}
Delayed::Job.enqueue( Observer::Ticket::Notification::BackgroundJob.new( params ) )

View file

@ -2,6 +2,7 @@ class Observer::Ticket::Notification::BackgroundJob
def initialize(params)
@ticket_id = params[:ticket_id]
@article_id = params[:article_id]
@type = params[:type]
@data = params[:data]
end
def perform
@ -42,13 +43,12 @@ class Observer::Ticket::Notification::BackgroundJob
recipient_list = ''
notification_subject = ''
recipients.each do |user|
OnlineNotification.add(
:type => type,
:type => @type,
:object => 'Ticket',
:o_id => ticket.id,
:seen => false,
:created_by_id => UserInfo.current_user_id || 1,
:created_by_id => article.created_by_id || 1,
:user_id => user.id,
)