Fixed bug in new rake task.

This commit is contained in:
Benjamin Meichsner 2009-08-14 13:50:05 +02:00
parent 27bec1f860
commit 4ba612aa5b

View file

@ -58,8 +58,10 @@ namespace :foodsoft do
for task in workgroup.tasks.all(:conditions => ["due_date = ?", 7.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? unless task.enough_users_assigned?
puts "Notify workgroup: #{workgroup.name} for task #{task.name}" 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? } for user in workgroup.users
Mailer.deliver_not_enough_users_assigned(task, user) if user.settings['messages.sendAsEmail'] == "1" && !user.email.blank?
Mailer.deliver_not_enough_users_assigned(task, user)
end
end end
end end
end end