Rake task for running outstanding account deletions
This commit is contained in:
parent
46e3c5a870
commit
ba223fd3d7
1 changed files with 15 additions and 0 deletions
15
lib/tasks/accounts.rake
Normal file
15
lib/tasks/accounts.rake
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
namespace :accounts do
|
||||||
|
desc "Run deletions"
|
||||||
|
task :run_deletions => :environment do
|
||||||
|
if ::AccountDeletion.count > 0
|
||||||
|
puts "Running account deletions.."
|
||||||
|
::AccountDeletion.find_each do |account_delete|
|
||||||
|
account_delete.perform!
|
||||||
|
end
|
||||||
|
puts "OK."
|
||||||
|
end
|
||||||
|
|
||||||
|
puts "No acccount deletions to run."
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
Loading…
Reference in a new issue