about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorJenkins <jenkins@jenkins.ninjawedding.org>2017-12-02 14:17:11 +0000
committerJenkins <jenkins@jenkins.ninjawedding.org>2017-12-02 14:17:11 +0000
commit933eafdcd3a3803e9fcf934f6f7ade667281c527 (patch)
tree94f5ab03f7cd733cc0743f3c79cf02a8de4c148f /app/controllers
parentad46bc9772dfc52c7ed522658eda1a3ef608a7b3 (diff)
parent51f2eca8877d8c56a19e1b8ce4edf407c2d236fb (diff)
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/invites_controller.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/admin/invites_controller.rb b/app/controllers/admin/invites_controller.rb
index f4207e3e2..faccaa7c8 100644
--- a/app/controllers/admin/invites_controller.rb
+++ b/app/controllers/admin/invites_controller.rb
@@ -5,7 +5,7 @@ module Admin
     def index
       authorize :invite, :index?
 
-      @invites = Invite.includes(user: :account).page(params[:page])
+      @invites = filtered_invites.includes(user: :account).page(params[:page])
       @invite  = Invite.new
     end
 
@@ -29,5 +29,19 @@ module Admin
       @invite.expire!
       redirect_to admin_invites_path
     end
+
+    private
+
+    def resource_params
+      params.require(:invite).permit(:max_uses, :expires_in)
+    end
+
+    def filtered_invites
+      InviteFilter.new(filter_params).results
+    end
+
+    def filter_params
+      params.permit(:available, :expired)
+    end
   end
 end