Skip to content
Snippets Groups Projects
Commit 3652a39d authored by alpaca-tc's avatar alpaca-tc Committed by Eugen Rochko
Browse files

Account.find_remote should be raise ActiveRecord::RecordNotFound (#3476)

parent 79335e46
No related branches found
No related tags found
No related merge requests found
......@@ -167,7 +167,7 @@ class Account < ApplicationRecord
end
def find_remote!(username, domain)
return if username.blank?
raise ActiveRecord::RecordNotFound if username.blank?
where('lower(accounts.username) = ?', username.downcase).where(domain.nil? ? { domain: nil } : 'lower(accounts.domain) = ?', domain&.downcase).take!
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment