From 3652a39de0d40acad1f2b170c74338b4fda01359 Mon Sep 17 00:00:00 2001 From: alpaca-tc Date: Wed, 31 May 2017 22:10:26 +0900 Subject: Account.find_remote should be raise ActiveRecord::RecordNotFound (#3476) --- app/models/account.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') 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 -- cgit