From fa051a2c758f253b456a913cccc928fbc69f85be Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 30 Jun 2016 13:37:13 +0200 Subject: [PATCH] Fixed line detection. --- app/models/transaction/signature_detection.rb | 3 ++- lib/signature_detection.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/transaction/signature_detection.rb b/app/models/transaction/signature_detection.rb index 7f85183cb..f44a5a230 100644 --- a/app/models/transaction/signature_detection.rb +++ b/app/models/transaction/signature_detection.rb @@ -52,10 +52,11 @@ class Transaction::SignatureDetection return if !user return if !user.preferences return if !user.preferences[:signature_detection] - article.preferences[:signature_detection] = SignatureDetection.find_signature_line_by_article( + line = SignatureDetection.find_signature_line_by_article( user, article ) + article.preferences[:signature_detection] = line article.save end diff --git a/lib/signature_detection.rb b/lib/signature_detection.rb index 18594b4cd..f0275bbe2 100644 --- a/lib/signature_detection.rb +++ b/lib/signature_detection.rb @@ -157,7 +157,7 @@ returns =end - def find_signature_line_by_article(user, article) + def self.find_signature_line_by_article(user, article) return if !user.preferences[:signature_detection] SignatureDetection.find_signature_line( user.preferences[:signature_detection],