debian-mirror-gitlab/app/services/search/snippet_service.rb
2015-04-26 09:18:37 +02:00

14 lines
339 B
Ruby

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