Create default path for brouillons procedures

This commit is contained in:
Mathieu Magnin 2019-03-06 18:34:37 +01:00
parent 44f28ec565
commit f96d1b1823
2 changed files with 41 additions and 0 deletions

View file

@ -0,0 +1,17 @@
namespace :after_party do
desc 'Deployment task: create_default_path_for_brouillons'
task create_default_path_for_brouillons: :environment do
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