Project

General

Profile

Defect #43838 » 0001-Add-index-to-users-login-and-optimize-mention-query-.patch

Marius BĂLTEANU, 2026-02-21 18:21

View differences:

app/helpers/application_helper.rb
1289 1289
                link = link_to_project(p, {:only_path => only_path}, :class => 'project')
1290 1290
              end
1291 1291
            when 'user'
1292
              u = User.visible.find_by("LOWER(login) = :s AND type = 'User'", :s => name.downcase)
1292
              u = User.visible.find_by(login: name.downcase)
1293 1293
              link = link_to_user(u, :only_path => only_path) if u
1294 1294
            end
1295 1295
          elsif sep == "@"
1296 1296
            name = remove_double_quotes(identifier)
1297
            u = User.visible.find_by("LOWER(login) = :s AND type = 'User'", :s => name.downcase)
1297
            u = User.visible.find_by(login: name.downcase)
1298 1298
            link = link_to_mention(u, obj, only_path: only_path) if u
1299 1299
          end
1300 1300
        end
db/migrate/20260221060647_add_index_to_users_login.rb
1
class AddIndexToUsersLogin < ActiveRecord::Migration[8.1]
2
  def change
3
    add_index :users, :login
4
  end
5
end
(2-2/2)