about summary refs log blame commit diff
path: root/app/controllers/admin/instances_controller.rb
blob: ac93248a8563f1f6810b88ba31396dd727a73a0a (plain) (tree)
1
2
3
4
5
6
7
8
9
10



                                            
                                    


           



                                                           
                         
                                                                 

       
# frozen_string_literal: true

module Admin
  class InstancesController < BaseController
    def index
      @instances = ordered_instances
    end

    private

    def paginated_instances
      Account.remote.by_domain_accounts.page(params[:page])
    end
    helper_method :paginated_instances

    def ordered_instances
      paginated_instances.map { |account| Instance.new(account) }
    end
  end
end