gitlab-org--gitlab-foss/app/controllers/search_controller.rb
Robert Speicher 7754189187 Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
2012-08-10 18:25:15 -04:00

15 lines
448 B
Ruby

class SearchController < ApplicationController
def show
query = params[:search]
@projects = []
@merge_requests = []
@issues = []
if query.present?
@projects = current_user.projects.search(query).limit(10)
@merge_requests = MergeRequest.where(project_id: current_user.project_ids).search(query).limit(10)
@issues = Issue.where(project_id: current_user.project_ids).search(query).limit(10)
end
end
end