diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-17 18:23:53 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-17 18:23:53 +0000 |
commit | bb0cd34f4e2e3aee82b763aa6f23518072e99f08 (patch) | |
tree | de3c3dc8ee6228ae4646389f720953d2313e531a /vendor | |
parent | 199eaff14ea3217efd0ee2592abb88798e465338 (diff) | |
download | redmine-bb0cd34f4e2e3aee82b763aa6f23518072e99f08.tar.gz redmine-bb0cd34f4e2e3aee82b763aa6f23518072e99f08.zip |
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
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb b/vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb index ea29d3a1b..ed19dc736 100644 --- a/vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb +++ b/vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb @@ -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) |