]> source.dussan.org Git - redmine.git/commitdiff
Make sure there's no nil result in auto_complete.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 12 Dec 2010 16:06:43 +0000 (16:06 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 12 Dec 2010 16:06:43 +0000 (16:06 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4503 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/auto_completes_controller.rb
test/functional/auto_completes_controller_test.rb

index a3ed88e36f2a5682e4e3adbfefcdb92d73d6a73f..feb1cb231771f124ebbf5d9714ced10d5b021754 100644 (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
 
index 697436b6ea7d282263c4ea3a0fbf32c56062d5d0..e5e898b15aefeebf2c14c4d3ffc9606eb4504f53 100644 (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