Add task to fill procedures table path column
This commit is contained in:
parent
5ab22ee139
commit
1cf65c1b89
1 changed files with 20 additions and 0 deletions
|
@ -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
|
Loading…
Reference in a new issue