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:
parent
a8b12bcb52
commit
29e0bca43a
|
@ -11,6 +11,7 @@ class AutoCompletesController < ApplicationController
|
||||||
unless q.blank?
|
unless q.blank?
|
||||||
@issues += query.visible.find(:all, :conditions => ["LOWER(#{Issue.table_name}.subject) LIKE ?", "%#{q.downcase}%"], :limit => 10)
|
@issues += query.visible.find(:all, :conditions => ["LOWER(#{Issue.table_name}.subject) LIKE ?", "%#{q.downcase}%"], :limit => 10)
|
||||||
end
|
end
|
||||||
|
@issues.compact!
|
||||||
render :layout => false
|
render :layout => false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,6 @@ class AutoCompletesControllerTest < ActionController::TestCase
|
||||||
Setting.cross_project_issue_relations = '0'
|
Setting.cross_project_issue_relations = '0'
|
||||||
get :issues, :project_id => 'ecookbook', :q => '13', :scope => 'all'
|
get :issues, :project_id => 'ecookbook', :q => '13', :scope => 'all'
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal [nil], assigns(:issues)
|
assert_equal [], assigns(:issues)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue