-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
db(after party): set forced_groupe_instructeur to false for brouillon…
… dossiers without groupe_instructeur
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...s/deployment/20230906124541_update_brouillon_dossiers_with_forced_groupe_instructeur.rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |