2017-04-18 20:09:07 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Admin
|
|
|
|
class InstancesController < BaseController
|
|
|
|
def index
|
2017-05-31 19:38:44 +01:00
|
|
|
@instances = ordered_instances
|
2017-04-18 20:09:07 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2017-05-31 19:38:44 +01:00
|
|
|
def paginated_instances
|
|
|
|
Account.remote.by_domain_accounts.page(params[:page])
|
|
|
|
end
|
|
|
|
helper_method :paginated_instances
|
|
|
|
|
2017-04-18 20:09:07 +01:00
|
|
|
def ordered_instances
|
2017-05-31 19:38:44 +01:00
|
|
|
paginated_instances.map { |account| Instance.new(account) }
|
2017-04-18 20:09:07 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|