Merge branch 'master' into allow-no-nickname

Conflicts:
	app/views/foodcoop/users/_users.html.haml
This commit is contained in:
wvengen 2013-10-29 19:15:52 +01:00
commit c37ed74942
84 changed files with 1712 additions and 2579 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
puts "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
puts "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
puts "deliver aborted for #{user.email}"
rake_say "deliver aborted for #{user.email}"
end
end
end
@ -47,3 +47,8 @@ namespace :foodsoft do
end
end
end
# Helper
def rake_say(message)
puts message unless Rake.application.options.silent
end

View file

@ -8,7 +8,7 @@ namespace :multicoops do
task :run => :environment do
task_to_run = ENV['TASK']
FoodsoftConfig.each_coop do |coop|
puts "Run '#{task_to_run}' for #{coop}"
rake_say "Run '#{task_to_run}' for #{coop}"
Rake::Task[task_to_run].execute
end
end
@ -17,8 +17,14 @@ namespace :multicoops do
task :run_single => :environment do
task_to_run = ENV['TASK']
FoodsoftConfig.select_foodcoop ENV['FOODCOOP']
puts "Run '#{task_to_run}' for #{ENV['FOODCOOP']}"
rake_say "Run '#{task_to_run}' for #{ENV['FOODCOOP']}"
Rake::Task[task_to_run].execute
end
end
# Helper
def rake_say(message)
puts message unless Rake.application.options.silent
end