relationships_controller.rb 619 B

1234567891011121314151617181920212223242526
  1. # frozen_string_literal: true
  2. module Admin
  3. class RelationshipsController < BaseController
  4. before_action :set_account
  5. PER_PAGE = 40
  6. def index
  7. authorize :account, :index?
  8. @accounts = RelationshipFilter.new(@account, filter_params).results.includes(:account_stat, user: [:ips, :invite_request]).page(params[:page]).per(PER_PAGE)
  9. @form = Form::AccountBatch.new
  10. end
  11. private
  12. def set_account
  13. @account = Account.find(params[:account_id])
  14. end
  15. def filter_params
  16. params.slice(*RelationshipFilter::KEYS).permit(*RelationshipFilter::KEYS)
  17. end
  18. end
  19. end