Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Bushong <bushong1@gmail.com>2014-09-05 21:30:55 +0400
committerCharles Bushong <bushong1@gmail.com>2014-09-05 21:30:55 +0400
commit858dbd084253d2920d7007babe0471469eb459e7 (patch)
tree9ac2119b4b6b81af2c3a420628d8f20d06053f74 /app/controllers/search_controller.rb
parentb1411e90f81ea87ad45dee324b13881095e031ea (diff)
Updating to persist a params snippets variable
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r--app/controllers/search_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index dab38858bf9..58ec8e75d7a 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -5,6 +5,7 @@ class SearchController < ApplicationController
@project = Project.find_by(id: params[:project_id]) if params[:project_id].present?
@group = Group.find_by(id: params[:group_id]) if params[:group_id].present?
@scope = params[:scope]
+ @show_snippets = params[:snippets].eql? 'true'
@search_results = if @project
return access_denied! unless can?(current_user, :download_code, @project)
@@ -14,7 +15,7 @@ class SearchController < ApplicationController
end
Search::ProjectService.new(@project, current_user, params).execute
- elsif params[:snippets].eql? 'true'
+ elsif @show_snippets
unless %w(snippet_blobs snippet_titles).include?(@scope)
@scope = 'snippet_blobs'
end