[#2179] Simplify matching_dossiers_for_gestionnaire
This commit is contained in:
parent
8744e9b83d
commit
8fc359c54d
1 changed files with 2 additions and 9 deletions
|
@ -1,14 +1,7 @@
|
||||||
class DossierSearchService
|
class DossierSearchService
|
||||||
def self.matching_dossiers_for_gestionnaire(search_terms, gestionnaire)
|
def self.matching_dossiers_for_gestionnaire(search_terms, gestionnaire)
|
||||||
# exact id match?
|
dossier_by_exact_id_for_gestionnaire(search_terms, gestionnaire)
|
||||||
dossiers = dossier_by_exact_id_for_gestionnaire(search_terms, gestionnaire)
|
.presence || dossier_by_full_text_for_gestionnaire(search_terms, gestionnaire)
|
||||||
|
|
||||||
# full text search
|
|
||||||
if dossiers.empty?
|
|
||||||
dossier = dossier_by_full_text_for_gestionnaire(search_terms, gestionnaire)
|
|
||||||
end
|
|
||||||
|
|
||||||
dossiers
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in a new issue