Commit bf6d5fe06493bef10c0716169109bb62e9ae728c
Committed by
Gabriela Navarro
1 parent
da994e1f
Exists in
master
and in
5 other branches
Fix error in software search filter
Signed-off-by: Álvaro Fernando <alvarofernandoms@gmail.com> Signed-off-by: Hebert Douglas <hebertdougl@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Showing
1 changed file
with
9 additions
and
4 deletions
Show diff stats
lib/ext/search_controller.rb
| ... | ... | @@ -52,16 +52,21 @@ class SearchController |
| 52 | 52 | end |
| 53 | 53 | |
| 54 | 54 | def filter_software_infos_list |
| 55 | - filtered_communities_list = SoftwareInfo.like_search(params[:query]) | |
| 55 | + filtered_software_list = SoftwareInfo.like_search(params[:query]) | |
| 56 | 56 | |
| 57 | 57 | if not params[:categories].blank? |
| 58 | 58 | @category_filters = params[:categories].select {|c| c.to_i != 0 } |
| 59 | - | |
| 60 | - filtered_communities_list.select! do |software| | |
| 59 | + | |
| 60 | + filtered_software_list.select! do |software| | |
| 61 | 61 | !(software.community.category_ids & @category_filters).blank? |
| 62 | 62 | end |
| 63 | 63 | end |
| 64 | 64 | |
| 65 | - filtered_communities_list | |
| 65 | + filtered_community_list = [] | |
| 66 | + filtered_software_list.each do |software| | |
| 67 | + filtered_community_list << software.community | |
| 68 | + end | |
| 69 | + | |
| 70 | + filtered_community_list | |
| 66 | 71 | end |
| 67 | 72 | end | ... | ... |