Merge pull request #5435 from betagouv/fix-5288-commentaires

last_commentaire_updated_at does not take system email into account
This commit is contained in:
Keirua 2020-07-30 11:59:47 +02:00 committed by GitHub
commit efca6745d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,10 @@ class TmpSetDossiersLastUpdatedAtJob < ApplicationJob
.limit(100) .limit(100)
dossiers.find_each do |dossier| 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_avis_updated_at = dossier.avis.maximum(:updated_at)
last_champ_updated_at = dossier.champs.maximum(:updated_at) last_champ_updated_at = dossier.champs.maximum(:updated_at)
last_champ_private_updated_at = dossier.champs_private.maximum(:updated_at) last_champ_private_updated_at = dossier.champs_private.maximum(:updated_at)