Skip to content

Commit

Permalink
feat(search): index mandataire name
Browse files Browse the repository at this point in the history
  • Loading branch information
colinux committed May 6, 2024
1 parent 39b0327 commit 6733b28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/concerns/dossier_searchable_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def index_search_terms
*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(' ')
Expand Down
8 changes: 8 additions & 0 deletions spec/models/concerns/dossier_searchable_concern_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,13 @@
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

0 comments on commit 6733b28

Please sign in to comment.