Remove nonworking after_party rake tasks
These tasks mention symbols that have been renamed or removed. (Gestionnaire, Procedure.administrateur (single), or VirusScan.) They won’t be run again. I guess some (most) of the other after_party and rake tasks could be removed too; it’s just that those prevent `rake after_party:run` to execute on a clean install.
This commit is contained in:
parent
28656cbad7
commit
e27fbf1a95
5 changed files with 0 additions and 88 deletions
|
@ -1,18 +0,0 @@
|
||||||
namespace :after_party do
|
|
||||||
desc 'Deployment task: add_procedure_administrateur_to_administrateurs'
|
|
||||||
task add_procedure_administrateur_to_administrateurs: :environment do
|
|
||||||
rake_puts "Running deploy task: 'add_procedure_administrateur_to_administrateurs'"
|
|
||||||
procedures = Procedure.includes(:administrateurs)
|
|
||||||
progress = ProgressReport.new(procedures.count)
|
|
||||||
|
|
||||||
procedures.find_each do |procedure|
|
|
||||||
if !procedure.administrateurs.include?(procedure.administrateur)
|
|
||||||
procedure.administrateurs << procedure.administrateur
|
|
||||||
end
|
|
||||||
progress.inc
|
|
||||||
end
|
|
||||||
|
|
||||||
progress.finish
|
|
||||||
AfterParty::TaskRecord.create version: '20190226101524'
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,22 +0,0 @@
|
||||||
namespace :after_party do
|
|
||||||
desc 'Deployment task: migrate_virus_scans'
|
|
||||||
task migrate_virus_scans: :environment do
|
|
||||||
puts "Running deploy task 'migrate_virus_scans'"
|
|
||||||
|
|
||||||
virus_scans = VirusScan.all
|
|
||||||
progress = ProgressReport.new(virus_scans.count)
|
|
||||||
virus_scans.find_each do |virus_scan|
|
|
||||||
blob = ActiveStorage::Blob.find_by(key: virus_scan.blob_key)
|
|
||||||
if blob
|
|
||||||
metadata = { virus_scan_result: virus_scan.status, scanned_at: virus_scan.scanned_at }
|
|
||||||
blob.update_column(:metadata, blob.metadata.merge(metadata))
|
|
||||||
end
|
|
||||||
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: '20190425102459'
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,19 +0,0 @@
|
||||||
namespace :after_party do
|
|
||||||
desc 'Deployment task: add_procedure_administrateur_to_administrateurs_for_hidden_procedures'
|
|
||||||
task add_procedure_administrateur_to_administrateurs_for_hidden_procedures: :environment do
|
|
||||||
rake_puts "Running deploy task: 'add_procedure_administrateur_to_administrateurs_for_hidden_procedures'"
|
|
||||||
hidden_procedures = Procedure.unscoped.hidden.includes(:administrateurs)
|
|
||||||
progress = ProgressReport.new(hidden_procedures.count)
|
|
||||||
|
|
||||||
hidden_procedures.find_each do |procedure|
|
|
||||||
deprecated_administrateur = Administrateur.find_by(id: procedure.administrateur_id)
|
|
||||||
if deprecated_administrateur && !procedure.administrateurs.include?(deprecated_administrateur)
|
|
||||||
procedure.administrateurs << deprecated_administrateur
|
|
||||||
end
|
|
||||||
progress.inc
|
|
||||||
end
|
|
||||||
|
|
||||||
progress.finish
|
|
||||||
AfterParty::TaskRecord.create version: '20190429103024'
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,8 +0,0 @@
|
||||||
namespace :after_party do
|
|
||||||
desc 'Deployment task: enable_secured_login_for_all'
|
|
||||||
task enable_secured_login_for_all: :environment do
|
|
||||||
Gestionnaire.update_all(features: { "enable_email_login_token": true })
|
|
||||||
|
|
||||||
AfterParty::TaskRecord.create version: '20190627142239'
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,21 +0,0 @@
|
||||||
namespace :after_party do
|
|
||||||
desc 'Deployment task: purge_unattached_piece_justificative'
|
|
||||||
task purge_unattached_piece_justificative: :environment do
|
|
||||||
puts "Running deploy task 'purge_unattached_piece_justificative'"
|
|
||||||
|
|
||||||
piece_justificatives = PieceJustificative.where(type_de_piece_justificative_id: nil)
|
|
||||||
progress = ProgressReport.new(piece_justificatives.count)
|
|
||||||
piece_justificatives.find_each do |pj|
|
|
||||||
# detach from dossier to ensure we do not trigger touch
|
|
||||||
pj.update_column(:dossier_id, nil)
|
|
||||||
pj.remove_content!
|
|
||||||
pj.destroy
|
|
||||||
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: '20190701131030'
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Add table
Reference in a new issue