amelioration(data_fixer.rake): ajoute la tache pour fixer les champs manquant a un dossier
This commit is contained in:
parent
e31347d1bf
commit
9527d19ae7
1 changed files with 15 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue