Patch #40691 ยป patch.diff
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)} |