mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 06:35:55 +02:00
Additional tests for SearchController and handle my_projects scope without memberships.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8266 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -62,6 +62,11 @@ module Redmine
|
||||
# projects argument can be either nil (will search all projects), a project or an array of projects
|
||||
# Returns the results and the results count
|
||||
def search(tokens, projects=nil, options={})
|
||||
if projects.is_a?(Array) && projects.empty?
|
||||
# no results
|
||||
return [[], 0]
|
||||
end
|
||||
|
||||
# TODO: make user an argument
|
||||
user = User.current
|
||||
tokens = [] << tokens unless tokens.is_a?(Array)
|
||||
|
||||
Reference in New Issue
Block a user