Skip to content

Commit

Permalink
db(after party): set forced_groupe_instructeur to false for brouillon…
Browse files Browse the repository at this point in the history
… dossiers without groupe_instructeur
  • Loading branch information
E-L-T committed Sep 6, 2023
1 parent f369e15 commit 39c5970
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace :after_party do
desc 'Deployment task: update_brouillon_dossiers_with_forced_groupe_instructeur'
task update_brouillon_dossiers_with_forced_groupe_instructeur: :environment do
puts "Running deploy task 'update_brouillon_dossiers_with_forced_groupe_instructeur'"

# Put your task implementation HERE.
dossiers_to_fix = Dossier.where(state: :brouillon).where(forced_groupe_instructeur: true).where(groupe_instructeur_id: nil)

dossiers_to_fix.update_all(forced_groupe_instructeur: false)

# 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

0 comments on commit 39c5970

Please sign in to comment.