mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 23:49:34 +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:
@ -203,7 +203,7 @@ class ApplicationController < ActionController::Base
|
||||
username_lower = params[:username].downcase
|
||||
username_lower.gsub!(/\.json$/, '')
|
||||
|
||||
user = User.where(username_lower: username_lower).first
|
||||
user = User.find_by(username_lower: username_lower)
|
||||
raise Discourse::NotFound.new if user.blank?
|
||||
|
||||
guardian.ensure_can_see!(user)
|
||||
|
Reference in New Issue
Block a user