debian-mirror-gitlab/app/services/search/snippet_service.rb

16 lines
323 B
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
module Search
class SnippetService
attr_accessor :current_user, :params
def initialize(user, params)
@current_user, @params = user, params.dup
end
def execute
2016-06-02 11:05:42 +05:30
snippets = Snippet.accessible_to(current_user)
Gitlab::SnippetSearchResults.new(snippets, params[:search])
2015-04-26 12:48:37 +05:30
end
end
end