@@ -29,13 +29,13 class AutoCompletesController < ApplicationController | |||
|
29 | 29 | scope = scope.open(status == 'o') |
|
30 | 30 | end |
|
31 | 31 | if issue_id.present? |
|
32 |
scope = scope.where( |
|
|
32 | scope = scope.where.not(:id => issue_id.to_i) | |
|
33 | 33 | end |
|
34 | 34 | if q.match(/\A#?(\d+)\z/) |
|
35 | 35 | @issues << scope.find_by_id($1.to_i) |
|
36 | 36 | end |
|
37 | 37 | |
|
38 |
@issues += scope.where("LOWER(#{Issue.table_name}.subject) LIKE LOWER(?)", "%#{q}%").order( |
|
|
38 | @issues += scope.where("LOWER(#{Issue.table_name}.subject) LIKE LOWER(?)", "%#{q}%").order(:id => :desc).limit(10).to_a | |
|
39 | 39 | @issues.compact! |
|
40 | 40 | end |
|
41 | 41 | render :layout => false |
General Comments 0
You need to be logged in to leave comments.
Login now