Defect #43838 » 0001-Add-index-to-users-login-and-optimize-mention-query-.patch
| app/helpers/application_helper.rb | ||
|---|---|---|
|
link = link_to_project(p, {:only_path => only_path}, :class => 'project')
|
||
|
end
|
||
|
when 'user'
|
||
|
u = User.visible.find_by("LOWER(login) = :s AND type = 'User'", :s => name.downcase)
|
||
|
u = User.visible.find_by(login: name.downcase)
|
||
|
link = link_to_user(u, :only_path => only_path) if u
|
||
|
end
|
||
|
elsif sep == "@"
|
||
|
name = remove_double_quotes(identifier)
|
||
|
u = User.visible.find_by("LOWER(login) = :s AND type = 'User'", :s => name.downcase)
|
||
|
u = User.visible.find_by(login: name.downcase)
|
||
|
link = link_to_mention(u, obj, only_path: only_path) if u
|
||
|
end
|
||
|
end
|
||
| db/migrate/20260221060647_add_index_to_users_login.rb | ||
|---|---|---|
|
class AddIndexToUsersLogin < ActiveRecord::Migration[8.1]
|
||
|
def change
|
||
|
add_index :users, :login
|
||
|
end
|
||
|
end
|
||