Commit 757e92d52eadd0fea43a4998e89f309f196c4396
1 parent
ffbbccb7
Exists in
spb-stable
and in
3 other branches
Prevent duplicate method names in helpers
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
1 changed file
with
5 additions
and
5 deletions
Show diff stats
app/helpers/search_helper.rb
| @@ -49,7 +49,7 @@ module SearchHelper | @@ -49,7 +49,7 @@ module SearchHelper | ||
| 49 | # Autocomplete results for the current project, if it's defined | 49 | # Autocomplete results for the current project, if it's defined |
| 50 | def project_autocomplete | 50 | def project_autocomplete |
| 51 | if @project && @project.repository.exists? && @project.repository.root_ref | 51 | if @project && @project.repository.exists? && @project.repository.root_ref |
| 52 | - prefix = simple_sanitize(@project.name_with_namespace) | 52 | + prefix = search_result_sanitize(@project.name_with_namespace) |
| 53 | ref = @ref || @project.repository.root_ref | 53 | ref = @ref || @project.repository.root_ref |
| 54 | 54 | ||
| 55 | [ | 55 | [ |
| @@ -74,7 +74,7 @@ module SearchHelper | @@ -74,7 +74,7 @@ module SearchHelper | ||
| 74 | def groups_autocomplete(term, limit = 5) | 74 | def groups_autocomplete(term, limit = 5) |
| 75 | current_user.authorized_groups.search(term).limit(limit).map do |group| | 75 | current_user.authorized_groups.search(term).limit(limit).map do |group| |
| 76 | { | 76 | { |
| 77 | - label: "group: #{simple_sanitize(group.name)}", | 77 | + label: "group: #{search_result_sanitize(group.name)}", |
| 78 | url: group_path(group) | 78 | url: group_path(group) |
| 79 | } | 79 | } |
| 80 | end | 80 | end |
| @@ -84,7 +84,7 @@ module SearchHelper | @@ -84,7 +84,7 @@ module SearchHelper | ||
| 84 | def projects_autocomplete(term, limit = 5) | 84 | def projects_autocomplete(term, limit = 5) |
| 85 | current_user.authorized_projects.search_by_title(term).non_archived.limit(limit).map do |p| | 85 | current_user.authorized_projects.search_by_title(term).non_archived.limit(limit).map do |p| |
| 86 | { | 86 | { |
| 87 | - label: "project: #{simple_sanitize(p.name_with_namespace)}", | 87 | + label: "project: #{search_result_sanitize(p.name_with_namespace)}", |
| 88 | url: project_path(p) | 88 | url: project_path(p) |
| 89 | } | 89 | } |
| 90 | end | 90 | end |
| @@ -94,13 +94,13 @@ module SearchHelper | @@ -94,13 +94,13 @@ module SearchHelper | ||
| 94 | def public_projects_autocomplete(term, limit = 5) | 94 | def public_projects_autocomplete(term, limit = 5) |
| 95 | Project.public_or_internal_only(current_user).search_by_title(term).non_archived.limit(limit).map do |p| | 95 | Project.public_or_internal_only(current_user).search_by_title(term).non_archived.limit(limit).map do |p| |
| 96 | { | 96 | { |
| 97 | - label: "project: #{simple_sanitize(p.name_with_namespace)}", | 97 | + label: "project: #{search_result_sanitize(p.name_with_namespace)}", |
| 98 | url: project_path(p) | 98 | url: project_path(p) |
| 99 | } | 99 | } |
| 100 | end | 100 | end |
| 101 | end | 101 | end |
| 102 | 102 | ||
| 103 | - def simple_sanitize(str) | 103 | + def search_result_sanitize(str) |
| 104 | Sanitize.clean(str) | 104 | Sanitize.clean(str) |
| 105 | end | 105 | end |
| 106 | end | 106 | end |