Make sure there's no nil result in auto_complete.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4503 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2010-12-12 16:06:43 +00:00
parent a8b12bcb52
commit 29e0bca43a
2 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ class AutoCompletesController < ApplicationController
unless q.blank?
@issues += query.visible.find(:all, :conditions => ["LOWER(#{Issue.table_name}.subject) LIKE ?", "%#{q.downcase}%"], :limit => 10)
end
@issues.compact!
render :layout => false
end

View File

@ -29,6 +29,6 @@ class AutoCompletesControllerTest < ActionController::TestCase
Setting.cross_project_issue_relations = '0'
get :issues, :project_id => 'ecookbook', :q => '13', :scope => 'all'
assert_response :success
assert_equal [nil], assigns(:issues)
assert_equal [], assigns(:issues)
end
end