demarches-normaliennes/lib/tasks/deployment/20180913161001_add_path_to_procedures.rake
2018-09-18 13:21:18 +02:00

20 lines
664 B
Ruby

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