Browse Source

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

closed-social-glitch-2
alpaca-tc 7 years ago
committed by Eugen Rochko
parent
commit
3652a39de0
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/models/account.rb

+ 1
- 1
app/models/account.rb View File

@ -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

Loading…
Cancel
Save