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

lolsob-rspec
alpaca-tc 2017-05-31 22:10:26 +09:00 committed by Eugen Rochko
parent 12e795d0a7
commit d04c02ac37
1 changed files with 1 additions and 1 deletions

View File

@ -167,7 +167,7 @@ class Account < ApplicationRecord
end end
def find_remote!(username, domain) 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! where('lower(accounts.username) = ?', username.downcase).where(domain.nil? ? { domain: nil } : 'lower(accounts.domain) = ?', domain&.downcase).take!
end end