Commit 1c4752602219b6568937433a74d1a7c1e04788c5
Committed by
Thiago Ribeiro
1 parent
72e64ce8
Exists in
master
and in
5 other branches
Fix for filter_communities on communities_block with another plugin
Showing
1 changed file
with
2 additions
and
10 deletions
Show diff stats
lib/ext/communities_block.rb
@@ -4,16 +4,9 @@ class CommunitiesBlock | @@ -4,16 +4,9 @@ class CommunitiesBlock | ||
4 | 4 | ||
5 | def profile_list | 5 | def profile_list |
6 | result = get_visible_profiles | 6 | result = get_visible_profiles |
7 | + valid_communities_string = Community.get_valid_communities_string | ||
7 | 8 | ||
8 | - list_without_software = [] | ||
9 | - | ||
10 | - result.each do |profile| | ||
11 | - if profile.class == Community && !profile.software? | ||
12 | - list_without_software << profile | ||
13 | - end | ||
14 | - end | ||
15 | - | ||
16 | - result = list_without_software | 9 | + result.each{|community| @scope.delete(community) unless eval(valid_communities_string)} |
17 | 10 | ||
18 | result.slice(0..get_limit-1) | 11 | result.slice(0..get_limit-1) |
19 | end | 12 | end |
@@ -45,5 +38,4 @@ class CommunitiesBlock | @@ -45,5 +38,4 @@ class CommunitiesBlock | ||
45 | ).sort_by {rand} | 38 | ).sort_by {rand} |
46 | end | 39 | end |
47 | end | 40 | end |
48 | - | ||
49 | end | 41 | end |