Link Dossier and GroupeInstructeur

This commit is contained in:
simon lehericey 2019-08-22 17:58:31 +02:00
parent 940813a3ab
commit 3cc8f0c792
12 changed files with 44 additions and 31 deletions

View file

@ -4,7 +4,7 @@ namespace :fix_timestamps_of_migrated_dossiers do
desc 'Fix the timestamps of dossiers affected by the faulty PJ migration'
task run: :environment do
affected_time_range = Time.utc(2019, 6, 4, 8, 0)..Time.utc(2019, 6, 4, 18, 0)
dossiers = Dossier.unscoped.where(procedure_id: 0..1000).where(updated_at: affected_time_range)
dossiers = Dossier.unscoped.includes(:groupe_instructeur).where(groupe_instructeurs: { procedure_id: 0..1000 }).where(updated_at: affected_time_range)
progress = ProgressReport.new(dossiers.count)