Browse Source

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
tags/1.1.0
Jean-Philippe Lang 13 years ago
parent
commit
29e0bca43a

+ 1
- 0
app/controllers/auto_completes_controller.rb 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


+ 1
- 1
test/functional/auto_completes_controller_test.rb 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

Loading…
Cancel
Save