Add an option to automatically finish an order

This commit is contained in:
Patrick Gansterer 2017-10-12 00:20:30 +02:00
parent c3927e4013
commit 564492afe4
10 changed files with 77 additions and 3 deletions

View file

@ -1,6 +1,11 @@
# put in here all foodsoft tasks
# => :environment loads the environment an gives easy access to the application
namespace :foodsoft do
desc "Finish ended orders"
task :finish_ended_orders => :environment do
Order.finish_ended!
end
desc "Notify users of upcoming tasks"
task :notify_upcoming_tasks => :environment do
tasks = Task.where(done: false, due_date: 1.day.from_now.to_date)