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,13 +58,15 @@ namespace :foodsoft do
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? }
for user in workgroup.users
if user.settings['messages.sendAsEmail'] == "1" && !user.email.blank?
Mailer.deliver_not_enough_users_assigned(task, user)
end
end
end
end
end
end
desc "Notify users of finished orders"
task :notify_order_finished => :environment do