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 | 49 | # Autocomplete results for the current project, if it's defined |
| 50 | 50 | def project_autocomplete |
| 51 | 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 | 53 | ref = @ref || @project.repository.root_ref |
| 54 | 54 | |
| 55 | 55 | [ |
| ... | ... | @@ -74,7 +74,7 @@ module SearchHelper |
| 74 | 74 | def groups_autocomplete(term, limit = 5) |
| 75 | 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 | 78 | url: group_path(group) |
| 79 | 79 | } |
| 80 | 80 | end |
| ... | ... | @@ -84,7 +84,7 @@ module SearchHelper |
| 84 | 84 | def projects_autocomplete(term, limit = 5) |
| 85 | 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 | 88 | url: project_path(p) |
| 89 | 89 | } |
| 90 | 90 | end |
| ... | ... | @@ -94,13 +94,13 @@ module SearchHelper |
| 94 | 94 | def public_projects_autocomplete(term, limit = 5) |
| 95 | 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 | 98 | url: project_path(p) |
| 99 | 99 | } |
| 100 | 100 | end |
| 101 | 101 | end |
| 102 | 102 | |
| 103 | - def simple_sanitize(str) | |
| 103 | + def search_result_sanitize(str) | |
| 104 | 104 | Sanitize.clean(str) |
| 105 | 105 | end |
| 106 | 106 | end | ... | ... |