From 332fc831c894f09ac563680929ea9a2b6dd694bc Mon Sep 17 00:00:00 2001 From: Benjamin Meichsner Date: Wed, 12 Aug 2009 21:47:07 +0200 Subject: [PATCH] Send warn messages for unassigned tasks 7 days before due date. --- lib/tasks/foodsoft.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/foodsoft.rake b/lib/tasks/foodsoft.rake index 2da5aa5d..5e308b1f 100644 --- a/lib/tasks/foodsoft.rake +++ b/lib/tasks/foodsoft.rake @@ -55,7 +55,7 @@ namespace :foodsoft do desc "Notify workgroup of upcoming weekly task" task :notify_users_of_weekly_task => :environment do for workgroup in Workgroup.all - for task in workgroup.tasks.all(:conditions => ["due_date = ?", 4.days.from_now.to_date]) + for task in workgroup.tasks.all(:conditions => ["due_date = ?", 7.days.from_now.to_date]) unless task.enough_users_assigned? puts "Notify workgroup: #{workgroup.name} for task #{task.name}" for user in workgroup.users.collect { |u| u if u.settings['messages.sendAsEmail'] == "1" && !u.email.blank? }