From b7f5c4f705483316f83ce2d26fb5f1a033962eaf Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 8 Oct 2015 17:13:41 +0200 Subject: [PATCH] Improved error handling. --- lib/signature_detection.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/signature_detection.rb b/lib/signature_detection.rb index 4af63872a..2a21dda43 100644 --- a/lib/signature_detection.rb +++ b/lib/signature_detection.rb @@ -138,6 +138,7 @@ returns tickets = Ticket.where(created_by_id: user_id, create_article_type_id: type.id, create_article_sender_id: sender.id).limit(5).order(id: :desc) tickets.each {|ticket| article = ticket.articles.first + next if !article article_bodies.push article.body } @@ -158,7 +159,7 @@ returns def self.rebuild_all_user - User.select('id').where(active: true).each {|local_user| + User.select('id').where(active: true).order(id: :desc).each {|local_user| rebuild_user(local_user.id) } true