diff options
author | alpaca-tc <alpaca-tc@alpaca.tc> | 2017-05-31 22:10:26 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-05-31 15:10:26 +0200 |
commit | 3652a39de0d40acad1f2b170c74338b4fda01359 (patch) | |
tree | cf292e486dd5b2dd81d46ee92bcb491ac6003f2a | |
parent | 79335e46fd784f21ef5e9c8ae861e6820e422e29 (diff) |
Account.find_remote should be raise ActiveRecord::RecordNotFound (#3476)
-rw-r--r-- | app/models/account.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |