Fixed bug in new rake task.
This commit is contained in:
parent
27bec1f860
commit
4ba612aa5b
1 changed files with 4 additions and 2 deletions
|
@ -58,13 +58,15 @@ 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
|
||||||
|
if user.settings['messages.sendAsEmail'] == "1" && !user.email.blank?
|
||||||
Mailer.deliver_not_enough_users_assigned(task, user)
|
Mailer.deliver_not_enough_users_assigned(task, user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
desc "Notify users of finished orders"
|
desc "Notify users of finished orders"
|
||||||
task :notify_order_finished => :environment do
|
task :notify_order_finished => :environment do
|
||||||
|
|
Loading…
Reference in a new issue