about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-10 03:34:15 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-10 03:34:15 +0200
commitaec51e40ee98b1a73d59b1456e61709d49c61552 (patch)
treeab8b721dcd64306a14ff18a48d68e12a719196d2 /app/models/account.rb
parent5f737c72282b981e3e637e5b4836ce45a161947c (diff)
Make account domains case-insensitive, downcase before checking against local
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index e43d51b1c..c1b52ea1b 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -125,7 +125,7 @@ class Account < ApplicationRecord
   end
 
   def self.find_remote!(username, domain)
-    where(arel_table[:username].matches(username)).where(domain: domain).take!
+    where(arel_table[:username].matches(username)).where(domain.nil? ? { domain: nil } : arel_table[:domain].matches(domain)).take!
   end
 
   def self.find_local(username)