about summary refs log tree commit diff
path: root/app/models/instance_filter.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-01-11 10:53:58 +0100
committerGitHub <noreply@github.com>2019-01-11 10:53:58 +0100
commit2cfa55185a5fc7d93a160a4e9a4730aae6725b0f (patch)
treec57169b5a3d717f4e68b8ec5d2d6e220d1456434 /app/models/instance_filter.rb
parentd1da0a1086fa25f22739277fbf32ba1b3745317d (diff)
parent394525e32994e605093c87d3a9fad2a4202f3401 (diff)
Merge pull request #885 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/instance_filter.rb')
-rw-r--r--app/models/instance_filter.rb17
1 files changed, 3 insertions, 14 deletions
diff --git a/app/models/instance_filter.rb b/app/models/instance_filter.rb
index 5073cf1fa..3483d8cd6 100644
--- a/app/models/instance_filter.rb
+++ b/app/models/instance_filter.rb
@@ -8,21 +8,10 @@ class InstanceFilter
   end
 
   def results
-    scope = Account.remote.by_domain_accounts
-    params.each do |key, value|
-      scope.merge!(scope_for(key, value)) if value.present?
-    end
-    scope
-  end
-
-  private
-
-  def scope_for(key, value)
-    case key.to_s
-    when 'domain_name'
-      Account.matches_domain(value)
+    if params[:limited].present?
+      DomainBlock.order(id: :desc)
     else
-      raise "Unknown filter: #{key}"
+      Account.remote.by_domain_accounts
     end
   end
 end