about summary refs log tree commit diff
path: root/app/controllers/admin/followers_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/admin/followers_controller.rb')
-rw-r--r--app/controllers/admin/followers_controller.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/controllers/admin/followers_controller.rb b/app/controllers/admin/followers_controller.rb
new file mode 100644
index 000000000..819628b20
--- /dev/null
+++ b/app/controllers/admin/followers_controller.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module Admin
+  class FollowersController < BaseController
+    before_action :set_account
+
+    PER_PAGE = 40
+
+    def index
+      authorize :account, :index?
+      @followers = followers.recent.page(params[:page]).per(PER_PAGE)
+    end
+
+    def set_account
+      @account = Account.find(params[:account_id])
+    end
+
+    def followers
+      Follow.includes(:account).where(target_account: @account)
+    end
+  end
+end