diff --git a/lib/tasks/data_fixer.rake b/lib/tasks/data_fixer.rake index b7b53fe65..19d70d9b8 100644 --- a/lib/tasks/data_fixer.rake +++ b/lib/tasks/data_fixer.rake @@ -26,4 +26,19 @@ namespace :data_fixer do end end end + + desc <<~EOD + Given a dossier_id in argument, run the DossierChampsMissing. + ex: rails data_fixer:dossier_missing_champ\[1\] + EOD + task :dossier_missing_champ, [:dossier_id] => :environment do |_t, args| + dossier = Dossier.find(args[:dossier_id]) + result = DataFixer::DossierChampsMissing.new(dossier:).fix + + if result > 0 + rake_puts "Dossier#[#{args[:dossier_id]}] fixed" + else + rake_puts "Dossier#[#{args[:dossier_id]}] not fixed" + end + end end