From aec51e40ee98b1a73d59b1456e61709d49c61552 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 10 Oct 2016 03:34:15 +0200 Subject: Make account domains case-insensitive, downcase before checking against local --- app/models/account.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/account.rb') 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) -- cgit