2019-08-27 15:28:02 +02:00
|
|
|
namespace :after_party do
|
|
|
|
desc 'Deployment task: create_default_groupe_instructeur'
|
|
|
|
task create_default_groupe_instructeur: :environment do
|
2019-09-09 13:41:08 +02:00
|
|
|
Procedure
|
2020-01-28 16:41:15 +01:00
|
|
|
.with_hidden
|
2019-09-09 13:41:08 +02:00
|
|
|
.left_outer_joins(:groupe_instructeurs)
|
|
|
|
.where('groupe_instructeurs.id is null')
|
|
|
|
.find_each do |procedure|
|
2019-08-27 15:28:02 +02:00
|
|
|
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
|