about summary refs log tree commit diff
path: root/app/controllers/admin/subscriptions_controller.rb
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-05-31 14:39:35 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-05-31 20:39:35 +0200
commitde4681b2be0b0efa1dede092445a53d4a593c140 (patch)
tree2b481f7ceef23f467dafaa4eba7e35db0559a42e /app/controllers/admin/subscriptions_controller.rb
parenta132332b861f997540f30be1b90ade4648834b5b (diff)
Move admin/pubsubhubbub controller to admin/subscriptions (#3442)
Diffstat (limited to 'app/controllers/admin/subscriptions_controller.rb')
-rw-r--r--app/controllers/admin/subscriptions_controller.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/controllers/admin/subscriptions_controller.rb b/app/controllers/admin/subscriptions_controller.rb
new file mode 100644
index 000000000..624a475a3
--- /dev/null
+++ b/app/controllers/admin/subscriptions_controller.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Admin
+  class SubscriptionsController < BaseController
+    def index
+      @subscriptions = ordered_subscriptions.page(requested_page)
+    end
+
+    private
+
+    def ordered_subscriptions
+      Subscription.order(id: :desc).includes(:account)
+    end
+
+    def requested_page
+      params[:page].to_i
+    end
+  end
+end