From 212724990341f48ecfc253a6c4a10eaa75709064 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 8 Oct 2015 12:28:27 +0200 Subject: [PATCH] Execute background job anyway. --- .../observer/ticket/article/email_signature_detection.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/observer/ticket/article/email_signature_detection.rb b/app/models/observer/ticket/article/email_signature_detection.rb index 639bb3c35..98c7c5a06 100644 --- a/app/models/observer/ticket/article/email_signature_detection.rb +++ b/app/models/observer/ticket/article/email_signature_detection.rb @@ -19,6 +19,9 @@ class Observer::Ticket::Article::EmailSignatureDetection < ActiveRecord::Observe type = Ticket::Article::Type.lookup( id: record.type_id ) return if type['name'] != 'email' + # add queue job to update current signature of user id + Delayed::Job.enqueue( Observer::Ticket::Article::SignatureDetection::BackgroundJob.new( record.created_by_id ) ) + # user user = User.lookup(id: record.created_by_id) return if !user @@ -26,8 +29,5 @@ class Observer::Ticket::Article::EmailSignatureDetection < ActiveRecord::Observe return if !user.preferences[:signature_detection] record.preferences[:signature_detection] = SignatureDetection.find_signature_line(user.preferences[:signature_detection], record.body) - - # add queue job to update current signature of user id - Delayed::Job.enqueue( Observer::Ticket::Article::SignatureDetection::BackgroundJob.new( record.created_by_id ) ) end end