From 9dd5639f90e7a256863a2b1fc199390def8bdb14 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 19 Aug 2018 00:58:53 +0200 Subject: Add admin function to deactivate all invites (#8279) Fix #8261 --- app/controllers/admin/invites_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/controllers/admin') diff --git a/app/controllers/admin/invites_controller.rb b/app/controllers/admin/invites_controller.rb index faccaa7c8..44a8eec77 100644 --- a/app/controllers/admin/invites_controller.rb +++ b/app/controllers/admin/invites_controller.rb @@ -30,6 +30,12 @@ module Admin redirect_to admin_invites_path end + def deactivate_all + authorize :invite, :deactivate_all? + Invite.available.in_batches.update_all(expires_at: Time.now.utc) + redirect_to admin_invites_path + end + private def resource_params -- cgit