feat(search): index mandataire name

This commit is contained in:
Colin Darie 2024-04-25 17:46:21 +02:00
parent 39b0327237
commit 6733b2884f
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
2 changed files with 11 additions and 1 deletions

View file

@ -18,7 +18,9 @@ module DossierSearchableConcern
*champs_public.flat_map(&:search_terms),
*etablissement&.search_terms,
individual&.nom,
individual&.prenom
individual&.prenom,
mandataire_first_name,
mandataire_last_name
].compact_blank.join(' ')
private_search_terms = champs_private.flat_map(&:search_terms).compact_blank.join(' ')

View file

@ -56,5 +56,13 @@ describe DossierSearchableConcern do
end
end
end
context 'mandataire' do
it "update columns" do
dossier.update(mandataire_first_name: "Chris")
perform_enqueued_jobs(only: DossierIndexSearchTermsJob)
expect(result["search_terms"]).to include("Chris")
end
end
end
end