Project

General

Profile

Patch #40691 ยป patch.diff

Vincent Robert, 2024-05-13 18:07

View differences:

app/models/project.rb
109 109
  scope :like, (lambda do |arg|
110 110
    if arg.present?
111 111
      pattern = "%#{sanitize_sql_like arg.to_s.strip}%"
112
      where("LOWER(identifier) LIKE LOWER(:p) ESCAPE :s OR LOWER(name) LIKE LOWER(:p) ESCAPE :s", :p => pattern, :s => '\\')
112
      where("LOWER(#{Project.table_name}.identifier) LIKE LOWER(:p) ESCAPE :s OR LOWER(#{Project.table_name}.name) LIKE LOWER(:p) ESCAPE :s", :p => pattern, :s => '\\')
113 113
    end
114 114
  end)
115 115
  scope :sorted, lambda {order(:lft)}
    (1-1/1)