summaryrefslogtreecommitdiff
path: root/app/controllers/search_controller.rb
diff options
context:
space:
mode:
authorCharles Bushong <bushong1@gmail.com>2014-08-29 15:22:45 -0400
committerCharles Bushong <bushong1@gmail.com>2014-08-29 15:32:07 -0400
commit4cca1b050a0e80e4ce6bb67f530549a2f28af630 (patch)
tree31d5c5897f7b5e041a921ba221042d1a9bb6a0e1 /app/controllers/search_controller.rb
parent8a7d10af2329342ca003300847ace4793c66f854 (diff)
downloadgitlab-ce-4cca1b050a0e80e4ce6bb67f530549a2f28af630.tar.gz
Adding in snippet search functionality
http://feedback.gitlab.com/forums/176466-general/suggestions/5529795-search-though-snippets
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r--app/controllers/search_controller.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index a58b24de643..dab38858bf9 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -14,6 +14,12 @@ class SearchController < ApplicationController
end
Search::ProjectService.new(@project, current_user, params).execute
+ elsif params[:snippets].eql? 'true'
+ unless %w(snippet_blobs snippet_titles).include?(@scope)
+ @scope = 'snippet_blobs'
+ end
+
+ Search::SnippetService.new(current_user, params).execute
else
unless %w(projects issues merge_requests).include?(@scope)
@scope = 'projects'