From 5de91cae96a6f6ffc6f2013ed43df242912d3ff8 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 16 Apr 2012 14:56:04 +0200 Subject: [PATCH] Reenabled notifications. --- app/controllers/ticket_articles_controller.rb | 10 +++++++++- app/controllers/tickets_controller.rb | 12 +++++++++++- app/models/channel/email_parser.rb | 2 -- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/controllers/ticket_articles_controller.rb b/app/controllers/ticket_articles_controller.rb index d6f911c6c..46f1f293a 100644 --- a/app/controllers/ticket_articles_controller.rb +++ b/app/controllers/ticket_articles_controller.rb @@ -27,13 +27,17 @@ class TicketArticlesController < ApplicationController ) if @article.save - render :json => @article, :status => :created # remove attachments from upload cache Store.remove( :object => 'UploadCache::TicketZoom::' + current_user.id.to_s, :o_id => @article.ticket_id ) + + # execute ticket events + Ticket::Observer::Notification.transaction + + render :json => @article, :status => :created else render :json => @article.errors, :status => :unprocessable_entity end @@ -44,6 +48,10 @@ class TicketArticlesController < ApplicationController @article = Ticket::Article.find(params[:id]) if @article.update_attributes(params[:ticket_article]) + + # execute ticket events + Ticket::Observer::Notification.transaction + render :json => @article, :status => :ok else render :json => @article.errors, :status => :unprocessable_entity diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index 7bf96cb92..c52758879 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -55,7 +55,10 @@ class TicketsController < ApplicationController :o_id => @article.ticket_id ) end - + + # execute ticket events + Ticket::Observer::Notification.transaction + render :json => @ticket, :status => :created end @@ -64,6 +67,10 @@ class TicketsController < ApplicationController @ticket = Ticket.find(params[:id]) if @ticket.update_attributes(params[:ticket]) + + # execute ticket events + Ticket::Observer::Notification.transaction + render :json => @ticket, :status => :ok else render :json => @ticket.errors, :status => :unprocessable_entity @@ -75,6 +82,9 @@ class TicketsController < ApplicationController @ticket = Ticket.find(params[:id]) @ticket.destroy + # execute ticket events + Ticket::Observer::Notification.transaction + head :ok end end diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index 8abc545c3..6a3af4c2e 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.rb @@ -117,8 +117,6 @@ class Channel::EmailParser ) end end - - return true end # execute ticket events