diff options
author | Charles Bushong <bushong1@gmail.com> | 2014-09-05 21:30:55 +0400 |
---|---|---|
committer | Charles Bushong <bushong1@gmail.com> | 2014-09-05 21:30:55 +0400 |
commit | 858dbd084253d2920d7007babe0471469eb459e7 (patch) | |
tree | 9ac2119b4b6b81af2c3a420628d8f20d06053f74 /app/controllers/search_controller.rb | |
parent | b1411e90f81ea87ad45dee324b13881095e031ea (diff) |
Updating to persist a params snippets variable
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r-- | app/controllers/search_controller.rb | 3 |
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 |