chore(type_de_champ): normalize (strip) all libelles
This commit is contained in:
parent
1981bfc88e
commit
ce175aed00
1 changed files with 22 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: strip_type_de_champ_libelle'
|
||||
task strip_type_de_champ_libelle: :environment do
|
||||
puts "Running deploy task 'strip_type_de_champ_libelle'"
|
||||
|
||||
# ~ 152K records matched
|
||||
tdcs = TypeDeChamp.where("libelle LIKE ?", ' %').or(TypeDeChamp.where("libelle LIKE ?", '% '))
|
||||
progress = ProgressReport.new(tdcs.count)
|
||||
|
||||
tdcs.find_each do |tdc|
|
||||
tdc.save!
|
||||
progress.inc
|
||||
end
|
||||
|
||||
progress.finish
|
||||
|
||||
# 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
|
Loading…
Reference in a new issue