debian-mirror-gitlab/app/services/search/snippet_service.rb
2019-12-21 20:55:43 +05:30

15 lines
368 B
Ruby

# frozen_string_literal: true
module Search
class SnippetService < Search::GlobalService
def execute
Gitlab::SnippetSearchResults.new(current_user, params[:search])
end
def scope
@scope ||= %w[snippet_titles].delete(params[:scope]) { 'snippet_blobs' }
end
end
end
Search::SnippetService.prepend_if_ee('::EE::Search::SnippetService')