You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
489 B

  1. # frozen_string_literal: true
  2. class InstanceFilter
  3. attr_reader :params
  4. def initialize(params)
  5. @params = params
  6. end
  7. def results
  8. if params[:limited].present?
  9. scope = DomainBlock
  10. scope = scope.matches_domain(params[:by_domain]) if params[:by_domain].present?
  11. scope.order(id: :desc)
  12. else
  13. scope = Account.remote
  14. scope = scope.matches_domain(params[:by_domain]) if params[:by_domain].present?
  15. scope.by_domain_accounts
  16. end
  17. end
  18. end