Allow changing number of automaticly created next weekly tasks.

This commit is contained in:
benni 2012-06-24 11:01:16 +02:00
parent ca68091914
commit 7d54a416df
5 changed files with 35 additions and 19 deletions

View file

@ -25,7 +25,7 @@ namespace :foodsoft do
workgroups = Workgroup.all :conditions => {:weekly_task => true}
for workgroup in workgroups
puts "Create weekly tasks for #{workgroup.name}"
workgroup.next_weekly_tasks(8)[3..5].each do |date|
workgroup.next_weekly_tasks[3..5].each do |date|
unless workgroup.tasks.exists?({:due_date => date, :weekly => true})
workgroup.tasks.create(workgroup.task_attributes(date))
end