From b3cb06b7e590d31adba6938a91d9b27ccb038f02 Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Tue, 31 Jul 2018 14:32:17 +0200 Subject: [PATCH] [#2179] Extract dossier_by_full_text_for_gestionnaire method --- app/services/dossier_search_service.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/services/dossier_search_service.rb b/app/services/dossier_search_service.rb index e95af3b8d..899ab383b 100644 --- a/app/services/dossier_search_service.rb +++ b/app/services/dossier_search_service.rb @@ -5,10 +5,7 @@ class DossierSearchService # full text search if dossiers.empty? - dossiers = Search.new( - gestionnaire: gestionnaire, - query: search_terms - ).results + dossier = dossier_by_full_text_for_gestionnaire(search_terms, gestionnaire) end dossiers @@ -41,4 +38,11 @@ class DossierSearchService false end end + + def self.dossier_by_full_text_for_gestionnaire(search_terms, gestionnaire) + Search.new( + gestionnaire: gestionnaire, + query: search_terms + ).results + end end