mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:11:20 +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:
@ -197,12 +197,12 @@ module Discourse
|
||||
|
||||
# Either returns the site_contact_username user or the first admin.
|
||||
def self.site_contact_user
|
||||
user = User.where(username_lower: SiteSetting.site_contact_username.downcase).first if SiteSetting.site_contact_username.present?
|
||||
user = User.find_by(username_lower: SiteSetting.site_contact_username.downcase) if SiteSetting.site_contact_username.present?
|
||||
user ||= User.admins.real.order(:id).first
|
||||
end
|
||||
|
||||
def self.system_user
|
||||
User.where(id: -1).first
|
||||
User.find_by(id: -1)
|
||||
end
|
||||
|
||||
def self.store
|
||||
|
Reference in New Issue
Block a user