Merge pull request #3191 from betagouv/fix-email-templates-subjects

tasks: rename `--libellé procédure--` to `--libellé démarche--`
This commit is contained in:
gregoirenovel 2018-12-19 13:55:58 +01:00 committed by GitHub
commit aaa22c1a18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,28 @@
namespace :after_party do
desc 'Deployment task: fix_email_templates_subjects'
task fix_email_templates_subjects: :environment do
puts "Running deploy task 'fix_email_templates_subjects'"
klasses = [
Mails::ClosedMail,
Mails::InitiatedMail,
Mails::ReceivedMail,
Mails::RefusedMail,
Mails::WithoutContinuationMail
]
klasses.each do |klass|
klass
.where("subject LIKE '%--libellé procédure--%'")
.each do |instance|
instance.update(subject: instance.subject.gsub("--libellé procédure--", "--libellé démarche--"))
rake_puts "Subject mis-à-jour pour #{klass.to_s}##{instance.id}"
end
end
# 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: '20181219122438'
end # task :fix_email_templates_subjects
end # namespace :after_party