Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
liberty
host
Smilodon
Commits
05413879
Commit
05413879
authored
Nov 26, 2016
by
Eugen Rochko
Browse files
Fix #288 - Strip first @ from search query, don't search accounts if it begins with #
parent
6c82dfcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/services/search_service.rb
View file @
05413879
...
...
@@ -2,9 +2,9 @@
class
SearchService
<
BaseService
def
call
(
query
,
limit
,
resolve
=
false
)
return
if
query
.
blank?
return
if
query
.
blank?
||
query
.
start_with?
(
'#'
)
username
,
domain
=
query
.
split
(
'@'
)
username
,
domain
=
query
.
gsub
(
/\A@/
,
''
).
split
(
'@'
)
results
=
if
domain
.
nil?
Account
.
search_for
(
username
)
...
...
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