Commit 20c65f3bcb9cba208abded1593dc2e50ea6347d2
1 parent
5a7f15fb
Exists in
master
and in
4 other branches
Search: show recent issues/mr first
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/contexts/search_context.rb
... | ... | @@ -19,8 +19,8 @@ class SearchContext |
19 | 19 | if params[:search_code].present? |
20 | 20 | result[:blobs] = project.repository.search_files(query, params[:repository_ref]) unless project.empty_repo? |
21 | 21 | else |
22 | - result[:merge_requests] = MergeRequest.in_projects(project_ids).search(query).limit(20) | |
23 | - result[:issues] = Issue.where(project_id: project_ids).search(query).limit(20) | |
22 | + result[:merge_requests] = MergeRequest.in_projects(project_ids).search(query).order('updated_at DESC').limit(20) | |
23 | + result[:issues] = Issue.where(project_id: project_ids).search(query).order('updated_at DESC').limit(20) | |
24 | 24 | result[:wiki_pages] = [] |
25 | 25 | end |
26 | 26 | result | ... | ... |