Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
3ff310865c41
Commit
3ff31086
authored
Aug 15, 2013
by
Dmitriy Zaporozhets
Browse files
Search: show recent issues/mr first
parent
94be6eee8448
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/contexts/search_context.rb
View file @
3ff31086
...
...
@@ -19,8 +19,8 @@
if
params
[
:search_code
].
present?
result
[
:blobs
]
=
project
.
repository
.
search_files
(
query
,
params
[
:repository_ref
])
unless
project
.
empty_repo?
else
result
[
:merge_requests
]
=
MergeRequest
.
in_projects
(
project_ids
).
search
(
query
).
limit
(
20
)
result
[
:issues
]
=
Issue
.
where
(
project_id:
project_ids
).
search
(
query
).
limit
(
20
)
result
[
:merge_requests
]
=
MergeRequest
.
in_projects
(
project_ids
).
search
(
query
).
order
(
'updated_at DESC'
).
limit
(
20
)
result
[
:issues
]
=
Issue
.
where
(
project_id:
project_ids
).
search
(
query
).
order
(
'updated_at DESC'
).
limit
(
20
)
result
[
:wiki_pages
]
=
[]
end
result
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment