tasks: remove old after_party tasks
Fixes a task that since became invalid: > NameError: uninitialized constant SeekAndDestroyExpiredDossiersJob > /lib/tasks/deployment/20191203142402_enable_seek_and_destroy_job
This commit is contained in:
parent
94df9ca514
commit
c41afc425e
21 changed files with 0 additions and 452 deletions
|
@ -1,14 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: fix_macedonia'
|
||||
task fix_macedonia: :environment do
|
||||
rake_puts "Running deploy task 'fix_macedonia'"
|
||||
|
||||
# Put your task implementation HERE.
|
||||
|
||||
Champ.where(type: "Champs::PaysChamp", value: "EX-REPUBLIQUE YOUGOSLAVE DE MACEDOINE").update_all(value: "MACEDOINE DU NORD (REPUBLIQUE DE)")
|
||||
|
||||
# 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: '20190212164238'
|
||||
end # task :fix_macedonia
|
||||
end # namespace :after_party
|
|
@ -1,17 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: create_default_path_for_brouillons'
|
||||
task create_default_path_for_brouillons: :environment do
|
||||
rake_puts "Running deploy task 'create_default_path_for_brouillons'"
|
||||
|
||||
# Put your task implementation HERE.
|
||||
|
||||
Procedure.brouillons.where(path: nil).each do |p|
|
||||
p.path = SecureRandom.uuid
|
||||
p.save
|
||||
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: '20190306172842'
|
||||
end # task :create_default_path_for_brouillons
|
||||
end # namespace :after_party
|
|
@ -1,26 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: migrate_mail_body_to_actiontext'
|
||||
task migrate_mail_body_to_actiontext: :environment do
|
||||
rake_puts "Running deploy task 'migrate_mail_body_to_actiontext'"
|
||||
|
||||
# Put your task implementation HERE.
|
||||
|
||||
[Mails::InitiatedMail, Mails::ReceivedMail, Mails::ClosedMail, Mails::WithoutContinuationMail, Mails::RefusedMail].each do |mt_class|
|
||||
progress = ProgressReport.new(mt_class.all.count)
|
||||
|
||||
mt_class.all.each do |mt|
|
||||
if mt.body.present?
|
||||
mt.rich_body = mt.body
|
||||
mt.save
|
||||
end
|
||||
progress.inc
|
||||
end
|
||||
|
||||
progress.finish
|
||||
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: '20190410131747'
|
||||
end # task :migrate_mail_body_to_actiontext
|
||||
end # namespace :after_party
|
|
@ -1,18 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: add_missing_dossier_id_to_repetitions'
|
||||
task add_missing_dossier_id_to_repetitions: :environment do
|
||||
rake_puts "Running deploy task 'add_missing_dossier_id_to_repetitions'"
|
||||
|
||||
champs = Champ.where(dossier_id: nil)
|
||||
progress = ProgressReport.new(champs.count)
|
||||
champs.find_each do |champ|
|
||||
champ.update_column(:dossier_id, champ.parent.dossier_id)
|
||||
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: '20190418144354'
|
||||
end
|
||||
end
|
|
@ -1,22 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: set_declarative_procedures'
|
||||
task set_declarative_procedures: :environment do
|
||||
rake_puts "Running deploy task 'set_declarative_procedures'"
|
||||
|
||||
Delayed::Job.where.not(cron: nil).find_each do |job|
|
||||
job_data = YAML.load_dj(job.handler).job_data
|
||||
|
||||
if job_data['job_class'] == 'AutoReceiveDossiersForProcedureJob'
|
||||
procedure_id, state = job_data['arguments']
|
||||
procedure = Procedure.find(procedure_id)
|
||||
procedure.declarative_with_state = state
|
||||
procedure.save!
|
||||
job.delete
|
||||
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: '20190523122639'
|
||||
end
|
||||
end
|
|
@ -1,10 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: populate_user_instructeur_ids'
|
||||
task populate_user_instructeur_ids: :environment do
|
||||
Instructeur.find_each do |instructeur|
|
||||
User.where(email: instructeur.email).update(instructeur_id: instructeur.id)
|
||||
end
|
||||
|
||||
AfterParty::TaskRecord.create version: '20190808145006'
|
||||
end
|
||||
end
|
|
@ -1,10 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: populate_user_administrateur_ids'
|
||||
task populate_user_administrateur_ids: :environment do
|
||||
Administrateur.find_each do |administrateur|
|
||||
User.where(email: administrateur.email).update(administrateur_id: administrateur.id)
|
||||
end
|
||||
|
||||
AfterParty::TaskRecord.create version: '20190809074534'
|
||||
end
|
||||
end
|
|
@ -1,30 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: clean_procedure_presentation_from_followers_gestionnaires'
|
||||
task clean_procedure_presentation_from_followers_gestionnaires: :environment do
|
||||
ProcedurePresentation.find_each do |pp|
|
||||
if pp.sort["table"] == "followers_gestionnaires"
|
||||
pp.sort["table"] = "followers_instructeurs"
|
||||
end
|
||||
|
||||
pp.displayed_fields.each do |df|
|
||||
if df["table"] == "followers_gestionnaires"
|
||||
df["table"] = "followers_instructeurs"
|
||||
end
|
||||
end
|
||||
|
||||
pp.filters.each do |(_name, values)|
|
||||
values.each do |value|
|
||||
if value["table"] == "followers_gestionnaires"
|
||||
value["table"] = "followers_instructeurs"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
pp.save!
|
||||
rescue StandardError
|
||||
end
|
||||
end
|
||||
AfterParty::TaskRecord.create version: '20190819100424'
|
||||
end
|
||||
end
|
|
@ -1,16 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: create_default_groupe_instructeur'
|
||||
task create_default_groupe_instructeur: :environment do
|
||||
Procedure
|
||||
.with_discarded
|
||||
.left_outer_joins(:groupe_instructeurs)
|
||||
.where('groupe_instructeurs.id is null')
|
||||
.find_each do |procedure|
|
||||
procedure.groupe_instructeurs.create(label: GroupeInstructeur::DEFAULT_LABEL)
|
||||
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: '20190819142551'
|
||||
end
|
||||
end
|
|
@ -1,15 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: link_assign_and_groupe_instructeur'
|
||||
task link_assign_and_groupe_instructeur: :environment do
|
||||
AssignTo.find_each do |at|
|
||||
GroupeInstructeur
|
||||
.find_by(procedure_id: at.procedure_id)
|
||||
&.assign_tos
|
||||
&.push(at)
|
||||
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: '20190819145528'
|
||||
end
|
||||
end
|
|
@ -1,14 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: rename_active_storage_attachments'
|
||||
task rename_active_storage_attachments: :environment do
|
||||
rake_puts "Running deploy task 'rename_active_storage_attachments'"
|
||||
|
||||
ActiveStorage::Attachment.where(name: 'logo_active_storage').update_all(name: 'logo')
|
||||
ActiveStorage::Attachment.where(name: 'signature_active_storage').update_all(name: 'signature')
|
||||
ActiveStorage::Attachment.where(name: 'pdf_active_storage').update_all(name: 'pdf')
|
||||
|
||||
# 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: '20190828130014'
|
||||
end
|
||||
end
|
|
@ -1,17 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: update_admin_last_sign_in_at'
|
||||
task update_admin_last_sign_in_at: :environment do
|
||||
sql = <<-SQL
|
||||
UPDATE users
|
||||
SET last_sign_in_at = administrateurs.updated_at
|
||||
FROM administrateurs
|
||||
WHERE administrateur_id = administrateurs.id
|
||||
AND users.last_sign_in_at IS NULL
|
||||
AND administrateurs.active = true
|
||||
SQL
|
||||
|
||||
ActiveRecord::Base.connection.execute(sql)
|
||||
|
||||
AfterParty::TaskRecord.create version: '20191007124230'
|
||||
end
|
||||
end
|
|
@ -1,15 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: archivee_to_close'
|
||||
task archivee_to_close: :environment do
|
||||
puts "Running deploy task 'archivee_to_close'"
|
||||
|
||||
Procedure.where(aasm_state: :archivee).update_all(aasm_state: :close)
|
||||
Procedure.where(aasm_state: :close, closed_at: nil).find_each do |procedure|
|
||||
procedure.update_column(:closed_at, procedure.archived_at)
|
||||
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: '20191114084623'
|
||||
end
|
||||
end
|
|
@ -1,8 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: enable_export_purge'
|
||||
task enable_export_purge: :environment do
|
||||
PurgeStaleExportsJob.set(cron: "*/5 * * * *").perform_later
|
||||
|
||||
AfterParty::TaskRecord.create version: '20191127135401'
|
||||
end
|
||||
end
|
|
@ -1,7 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: enable_seek_and_destroy_job'
|
||||
task enable_seek_and_destroy_job: :environment do
|
||||
SeekAndDestroyExpiredDossiersJob.set(cron: "0 7 * * *").perform_later
|
||||
AfterParty::TaskRecord.create version: '20191203142402'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue