about summary refs log tree commit diff
path: root/app/models/concerns/account_finder_concern.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-02-03 09:22:58 +0100
committerThibaut Girka <thib@sitedethib.com>2020-02-03 09:22:58 +0100
commit369201a425f7b539290815402a4bc65923911e11 (patch)
tree45de36cd6aa8c22aaf4be6cefaeeb70218d4daf5 /app/models/concerns/account_finder_concern.rb
parent4cd2d13bd226c005317adf9848f4c0316401b2ff (diff)
parent3adc722d1cdd28d87d2724b8952d7ec52d241b52 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/models/concerns/account_finder_concern.rb')
-rw-r--r--app/models/concerns/account_finder_concern.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/concerns/account_finder_concern.rb b/app/models/concerns/account_finder_concern.rb
index a54c2174d..04b2c981b 100644
--- a/app/models/concerns/account_finder_concern.rb
+++ b/app/models/concerns/account_finder_concern.rb
@@ -48,7 +48,7 @@ module AccountFinderConcern
     end
 
     def with_usernames
-      Account.where.not(username: '')
+      Account.where.not(Account.arel_table[:username].lower.eq '')
     end
 
     def matching_username
@@ -56,11 +56,7 @@ module AccountFinderConcern
     end
 
     def matching_domain
-      if domain.nil?
-        Account.where(domain: nil)
-      else
-        Account.where(Account.arel_table[:domain].lower.eq domain.to_s.downcase)
-      end
+      Account.where(Account.arel_table[:domain].lower.eq(domain.nil? ? nil : domain.to_s.downcase))
     end
   end
 end