Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
757e92d5
Commit
757e92d5
authored
Jan 18, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent duplicate method names in helpers
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
ffbbccb7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+5
-5
No files found.
app/helpers/search_helper.rb
View file @
757e92d5
...
@@ -49,7 +49,7 @@ module SearchHelper
...
@@ -49,7 +49,7 @@ module SearchHelper
# Autocomplete results for the current project, if it's defined
# Autocomplete results for the current project, if it's defined
def
project_autocomplete
def
project_autocomplete
if
@project
&&
@project
.
repository
.
exists?
&&
@project
.
repository
.
root_ref
if
@project
&&
@project
.
repository
.
exists?
&&
@project
.
repository
.
root_ref
prefix
=
s
imple
_sanitize
(
@project
.
name_with_namespace
)
prefix
=
s
earch_result
_sanitize
(
@project
.
name_with_namespace
)
ref
=
@ref
||
@project
.
repository
.
root_ref
ref
=
@ref
||
@project
.
repository
.
root_ref
[
[
...
@@ -74,7 +74,7 @@ module SearchHelper
...
@@ -74,7 +74,7 @@ module SearchHelper
def
groups_autocomplete
(
term
,
limit
=
5
)
def
groups_autocomplete
(
term
,
limit
=
5
)
current_user
.
authorized_groups
.
search
(
term
).
limit
(
limit
).
map
do
|
group
|
current_user
.
authorized_groups
.
search
(
term
).
limit
(
limit
).
map
do
|
group
|
{
{
label:
"group:
#{
s
imple
_sanitize
(
group
.
name
)
}
"
,
label:
"group:
#{
s
earch_result
_sanitize
(
group
.
name
)
}
"
,
url:
group_path
(
group
)
url:
group_path
(
group
)
}
}
end
end
...
@@ -84,7 +84,7 @@ module SearchHelper
...
@@ -84,7 +84,7 @@ module SearchHelper
def
projects_autocomplete
(
term
,
limit
=
5
)
def
projects_autocomplete
(
term
,
limit
=
5
)
current_user
.
authorized_projects
.
search_by_title
(
term
).
non_archived
.
limit
(
limit
).
map
do
|
p
|
current_user
.
authorized_projects
.
search_by_title
(
term
).
non_archived
.
limit
(
limit
).
map
do
|
p
|
{
{
label:
"project:
#{
s
imple
_sanitize
(
p
.
name_with_namespace
)
}
"
,
label:
"project:
#{
s
earch_result
_sanitize
(
p
.
name_with_namespace
)
}
"
,
url:
project_path
(
p
)
url:
project_path
(
p
)
}
}
end
end
...
@@ -94,13 +94,13 @@ module SearchHelper
...
@@ -94,13 +94,13 @@ module SearchHelper
def
public_projects_autocomplete
(
term
,
limit
=
5
)
def
public_projects_autocomplete
(
term
,
limit
=
5
)
Project
.
public_or_internal_only
(
current_user
).
search_by_title
(
term
).
non_archived
.
limit
(
limit
).
map
do
|
p
|
Project
.
public_or_internal_only
(
current_user
).
search_by_title
(
term
).
non_archived
.
limit
(
limit
).
map
do
|
p
|
{
{
label:
"project:
#{
s
imple
_sanitize
(
p
.
name_with_namespace
)
}
"
,
label:
"project:
#{
s
earch_result
_sanitize
(
p
.
name_with_namespace
)
}
"
,
url:
project_path
(
p
)
url:
project_path
(
p
)
}
}
end
end
end
end
def
s
imple
_sanitize
(
str
)
def
s
earch_result
_sanitize
(
str
)
Sanitize
.
clean
(
str
)
Sanitize
.
clean
(
str
)
end
end
end
end
Write
Preview
Markdown
is supported
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