about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-05-31 14:38:44 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-05-31 20:38:44 +0200
commita132332b861f997540f30be1b90ade4648834b5b (patch)
tree312364eef2a971ec97be48f2be71dc7702d6c578 /app/controllers
parentb25e42a77f4b3472bc519e8a394b2cfe0e063e4c (diff)
Add Instance class to list admin records (#3443)
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/instances_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/admin/instances_controller.rb b/app/controllers/admin/instances_controller.rb
index b8f170ec2..ac93248a8 100644
--- a/app/controllers/admin/instances_controller.rb
+++ b/app/controllers/admin/instances_controller.rb
@@ -3,13 +3,18 @@
 module Admin
   class InstancesController < BaseController
     def index
-      @instances = ordered_instances.page(params[:page])
+      @instances = ordered_instances
     end
 
     private
 
+    def paginated_instances
+      Account.remote.by_domain_accounts.page(params[:page])
+    end
+    helper_method :paginated_instances
+
     def ordered_instances
-      Account.remote.by_domain_accounts
+      paginated_instances.map { |account| Instance.new(account) }
     end
   end
 end