2012-03-16 00:14:39 +01:00
|
|
|
class SearchController < ApplicationController
|
|
|
|
def show
|
|
|
|
query = params[:search]
|
2012-07-31 07:32:49 +02:00
|
|
|
|
|
|
|
@projects = []
|
|
|
|
@merge_requests = []
|
|
|
|
@issues = []
|
|
|
|
|
|
|
|
if query.present?
|
2012-04-14 10:16:11 +02:00
|
|
|
@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)
|
2012-03-16 00:14:39 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|