about summary refs log tree commit diff
path: root/app/models/instance_filter.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-02-18 14:59:19 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-02-18 14:59:19 +0100
commit6840a77711b2d536b9227b5a96ec565117d80205 (patch)
tree086b2d8cc6d47b5aadcf3e887f9d998943808632 /app/models/instance_filter.rb
parent2f7f6af26a40fb9981c99d131cf021c71f24fb99 (diff)
Add domain search/filter to the "Federation" (/admin/instances) page (#10071)
Diffstat (limited to 'app/models/instance_filter.rb')
-rw-r--r--app/models/instance_filter.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/instance_filter.rb b/app/models/instance_filter.rb
index 3483d8cd6..848fff53e 100644
--- a/app/models/instance_filter.rb
+++ b/app/models/instance_filter.rb
@@ -9,9 +9,13 @@ class InstanceFilter
 
   def results
     if params[:limited].present?
-      DomainBlock.order(id: :desc)
+      scope = DomainBlock
+      scope = scope.matches_domain(params[:by_domain]) if params[:by_domain].present?
+      scope.order(id: :desc)
     else
-      Account.remote.by_domain_accounts
+      scope = Account.remote
+      scope = scope.matches_domain(params[:by_domain]) if params[:by_domain].present?
+      scope.by_domain_accounts
     end
   end
 end