Suggestion refacto by Tchak

Co-authored-by: Paul Chavard <paul.chavard@beta.gouv.fr>
This commit is contained in:
Lisa Durand 2023-07-11 11:53:46 +02:00 committed by GitHub
parent 4084f814b3
commit ea47c2cc19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,7 @@ class DossierSearchService
def self.matching_dossiers_for_user(search_terms, user)
dossier_by_exact_id_for_user(search_terms, user)
.presence || dossier_by_full_text_for_user(search_terms, user.dossiers).presence || dossier_by_full_text_for_user(search_terms, user.dossiers_invites)
.presence || dossier_by_full_text_for_user(search_terms, Dossier.where(id: user.dossiers.ids + user.dossiers_invites.ids))
end
private