Send emails to current budget authors in rake tasks

We were using `Budget.last`, but the last budget might not be published
yet.

I must admit I don't know whether these tasks are useful, but I'm not
removing them because I'm not sure that won't harm any CONSUL
installations.
This commit is contained in:
Javi Martín
2022-10-08 21:24:15 +02:00
parent a98c363d4d
commit 796214528e
2 changed files with 33 additions and 2 deletions

View File

@@ -2,12 +2,12 @@ namespace :budgets do
namespace :email do
desc "Sends emails to authors of selected investments"
task selected: :environment do
Budget.last.email_selected
Budget.current.email_selected
end
desc "Sends emails to authors of unselected investments"
task unselected: :environment do
Budget.last.email_unselected
Budget.current.email_unselected
end
end
end