fix(search): preload before updating search terms because we access all champs

This commit is contained in:
Colin Darie 2024-04-25 17:51:54 +02:00
parent 4408824882
commit 797bd6b94b
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -11,6 +11,8 @@ module DossierSearchableConcern
kredis_flag :debounce_update_search_terms_flag kredis_flag :debounce_update_search_terms_flag
def update_search_terms def update_search_terms
DossierPreloader.load_one(self)
search_terms = [ search_terms = [
user&.email, user&.email,
*champs_public.flat_map(&:search_terms), *champs_public.flat_map(&:search_terms),