about summary refs log tree commit diff
path: root/app/models/account_filter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/account_filter.rb')
-rw-r--r--app/models/account_filter.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/app/models/account_filter.rb b/app/models/account_filter.rb
index c3b1fe08d..c7bf07787 100644
--- a/app/models/account_filter.rb
+++ b/app/models/account_filter.rb
@@ -1,6 +1,21 @@
 # frozen_string_literal: true
 
 class AccountFilter
+  KEYS = %i(
+    local
+    remote
+    by_domain
+    active
+    pending
+    silenced
+    suspended
+    username
+    display_name
+    email
+    ip
+    staff
+  ).freeze
+
   attr_reader :params
 
   def initialize(params)
@@ -50,7 +65,7 @@ class AccountFilter
     when 'email'
       accounts_with_users.merge User.matches_email(value)
     when 'ip'
-      valid_ip?(value) ? accounts_with_users.where('users.current_sign_in_ip <<= ?', value) : Account.none
+      valid_ip?(value) ? accounts_with_users.merge(User.matches_ip(value)) : Account.none
     when 'staff'
       accounts_with_users.merge User.staff
     else