Merge commit '1cdb9e8501' into rails3-multiple-recurring-tasks
Conflicts: Gemfile db/schema.rb
This commit is contained in:
commit
981944b869
7 changed files with 75 additions and 3 deletions
|
|
@ -51,4 +51,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue