Outlined new concept for multiple periodically recurring tasks (#3).

This commit is contained in:
Robert Waltemath 2012-11-28 10:13:54 +01:00
parent 1822b330d1
commit 1cdb9e8501
7 changed files with 73 additions and 8 deletions

View file

@ -49,4 +49,15 @@ namespace :foodsoft do
end
end
end
desc "Create upcoming periodic tasks"
task :create_upcoming_periodic_tasks => :environment do
for tg in PeriodicTaskGroup.all
if tg.has_next_task?
while tg.next_task_date.nil? or tg.next_task_date < Date.today + 30
tg.create_next_task
end
end
end
end
end