diff --git a/app/jobs/tmp_set_dossiers_last_updated_at_job.rb b/app/jobs/tmp_set_dossiers_last_updated_at_job.rb index ca0b69997..80c15e043 100644 --- a/app/jobs/tmp_set_dossiers_last_updated_at_job.rb +++ b/app/jobs/tmp_set_dossiers_last_updated_at_job.rb @@ -7,7 +7,10 @@ class TmpSetDossiersLastUpdatedAtJob < ApplicationJob .limit(100) dossiers.find_each do |dossier| - last_commentaire_updated_at = dossier.commentaires.maximum(:updated_at) + last_commentaire_updated_at = dossier.commentaires + .where.not(email: OLD_CONTACT_EMAIL) + .where.not(email: CONTACT_EMAIL) + .maximum(:updated_at) last_avis_updated_at = dossier.avis.maximum(:updated_at) last_champ_updated_at = dossier.champs.maximum(:updated_at) last_champ_private_updated_at = dossier.champs_private.maximum(:updated_at)