2014-08-29 15:22:45 -04:00
|
|
|
module Search
|
|
|
|
class SnippetService
|
|
|
|
attr_accessor :current_user, :params
|
|
|
|
|
|
|
|
def initialize(user, params)
|
|
|
|
@current_user, @params = user, params.dup
|
|
|
|
end
|
|
|
|
|
|
|
|
def execute
|
2016-03-01 12:01:09 -05:00
|
|
|
snippets = Snippet.accessible_to(current_user)
|
|
|
|
|
|
|
|
Gitlab::SnippetSearchResults.new(snippets, params[:search])
|
2014-08-29 15:22:45 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|