mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Perform the where(...).first to find_by(...) refactoring.
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
This commit is contained in:
parent
f1369e4503
commit
1574485443
104 changed files with 204 additions and 213 deletions
|
@ -13,7 +13,7 @@ class IncomingLink < ActiveRecord::Base
|
|||
user_id, host, referer = nil
|
||||
|
||||
if request['u']
|
||||
u = User.select(:id).where(username_lower: request['u'].downcase).first
|
||||
u = User.select(:id).find_by(username_lower: request["u"].downcase)
|
||||
user_id = u.id if u
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue