Fixed created_by_id.

This commit is contained in:
Martin Edenhofer 2012-09-04 18:40:13 +02:00
parent f75c9f6a76
commit 660ccf9a72

View file

@ -8,8 +8,8 @@ class Ticket::Observer::Notification < ActiveRecord::Observer
# puts '@@event_buffer' # puts '@@event_buffer'
# puts @@event_buffer.inspect # puts @@event_buffer.inspect
@@event_buffer.each { |event| @@event_buffer.each { |event|
# get current state ob objects # get current state of objects
if event[:name] == 'Ticket::Article' if event[:name] == 'Ticket::Article'
article = Ticket::Article.find( event[:id] ) article = Ticket::Article.find( event[:id] )
ticket = article.ticket ticket = article.ticket
@ -49,7 +49,7 @@ From: #{article.from}
# send new ticket notification to customers # send new ticket notification to customers
if event[:name] == 'Ticket' && event[:type] == 'create' if event[:name] == 'Ticket' && event[:type] == 'create'
# only for incoming emails # only for incoming emails
next if article.ticket_article_type.name != 'email' next if article.ticket_article_type.name != 'email'
@ -222,7 +222,7 @@ From: #{article.from}
:history_object => 'Ticket', :history_object => 'Ticket',
:value_from => notification_subject, :value_from => notification_subject,
:value_to => recipient_list, :value_to => recipient_list,
:created_by_id => ticket.created_by_id || 1 :created_by_id => article.created_by_id || 1
) )
end end
end end