diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-07-31 08:32:49 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-07-31 08:32:49 +0300 |
commit | 5926bbac12d5831e1ad90964272b96e152a72e34 (patch) | |
tree | e222160f8f35e7dd772dbd124eef089592efc9c2 /app/controllers/search_controller.rb | |
parent | 69e41250d1b1eea609ae63f2702d5888396cba9a (diff) | |
download | gitlab-ce-5926bbac12d5831e1ad90964272b96e152a72e34.tar.gz |
Backend Refactoring
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r-- | app/controllers/search_controller.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index dfc318c5fb1..30bcb49bb2e 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -1,11 +1,12 @@ class SearchController < ApplicationController def show query = params[:search] - if query.blank? - @projects = [] - @merge_requests = [] - @issues = [] - else + + @projects = [] + @merge_requests = [] + @issues = [] + + if query.present? @projects = current_user.projects.search(query).limit(10) @merge_requests = MergeRequest.where(:project_id => current_user.project_ids).search(query).limit(10) @issues = Issue.where(:project_id => current_user.project_ids).search(query).limit(10) |