From: alpaca-tc Date: Wed, 31 May 2017 13:10:26 +0000 (+0900) Subject: Account.find_remote should be raise ActiveRecord::RecordNotFound (#3476) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=3652a39de0d40acad1f2b170c74338b4fda01359;p=mastodon.git Account.find_remote should be raise ActiveRecord::RecordNotFound (#3476) --- diff --git a/app/models/account.rb b/app/models/account.rb index f5ac89257..cb116dbaf 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -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