From ba223fd3d7c942790b57a437e7c68dee59bb7445 Mon Sep 17 00:00:00 2001 From: Ruxton Date: Mon, 19 May 2014 16:05:16 +0800 Subject: [PATCH] Rake task for running outstanding account deletions --- lib/tasks/accounts.rake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/tasks/accounts.rake diff --git a/lib/tasks/accounts.rake b/lib/tasks/accounts.rake new file mode 100644 index 000000000..1fcfbb553 --- /dev/null +++ b/lib/tasks/accounts.rake @@ -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