Add task to fill procedures table path column

This commit is contained in:
Paul Chavard 2018-09-13 18:20:01 +02:00
parent 5ab22ee139
commit 1cf65c1b89

View file

@ -0,0 +1,20 @@
namespace :after_party do
desc 'Deployment task: add_path_to_procedures'
task add_path_to_procedures: :environment do
puts "Running deploy task 'add_path_to_procedures'"
Procedure.publiees.where(path: nil).find_each do |procedure|
procedure.path = procedure.path
procedure.save!
end
Procedure.archivees.where(path: nil).find_each do |procedure|
procedure.path = procedure.path
procedure.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: '20180913161001'
end
end