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