donnees(correctif): corrige les transfers de dossiers ayant un email contenant des lettres capitales

This commit is contained in:
Martin 2023-01-31 14:37:22 +01:00 committed by mfo
parent 88553eec9b
commit f6aa30763a

View file

@ -0,0 +1,20 @@
namespace :after_party do
desc 'Deployment task: fix_dossier_transfer_with_uppercase'
task fix_dossier_transfer_with_uppercase: :environment do
puts "Running deploy task 'fix_dossier_transfer_with_uppercase'"
# in production, about 1000, no need to track progress
DossierTransfer.all.find_each do |dt|
if /A-Z/.match?(dt.email)
dt.email = dt.email.downcase
dt.save
end
end
# Put your task implementation HERE.
# Update task as completed. If you remove the line below, the task will
# run with every deploy (or every time you call after_party:run).
AfterParty::TaskRecord
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
end
end