workaround migration bug introduced by 975bcdec3a

This commit is contained in:
wvengen 2013-09-30 10:57:54 +02:00
parent 817d61491e
commit 6632f5ed75
2 changed files with 8 additions and 8 deletions

View file

@ -5,12 +5,12 @@ namespace :foodsoft do
task :notify_upcoming_tasks => :environment do
tasks = Task.where(done: false, due_date: 1.day.from_now.to_date)
for task in tasks
say "Send notifications for #{task.name} to .."
rake_say "Send notifications for #{task.name} to .."
for user in task.users
begin
Mailer.upcoming_tasks(user, task).deliver if user.settings.notify['upcoming_tasks'] == 1
rescue
say "deliver aborted for #{user.email}.."
rake_say "deliver aborted for #{user.email}.."
end
end
end
@ -27,7 +27,7 @@ namespace :foodsoft do
begin
Mailer.not_enough_users_assigned(task, user).deliver
rescue
say "deliver aborted for #{user.email}"
rake_say "deliver aborted for #{user.email}"
end
end
end
@ -49,6 +49,6 @@ namespace :foodsoft do
end
# Helper
def say(message)
def rake_say(message)
puts message unless Rake.application.options.silent
end