debian-mirror-gitlab/app/services/search/snippet_service.rb
2016-06-02 11:05:42 +05:30

15 lines
323 B
Ruby

module Search
class SnippetService
attr_accessor :current_user, :params
def initialize(user, params)
@current_user, @params = user, params.dup
end
def execute
snippets = Snippet.accessible_to(current_user)
Gitlab::SnippetSearchResults.new(snippets, params[:search])
end
end
end