diff --git a/app/models/feed.rb b/app/models/feed.rb index be7e2c1be0..3fd3b5b618 100755 --- a/app/models/feed.rb +++ b/app/models/feed.rb @@ -143,7 +143,7 @@ def filtered_clusters(args = {}) query = self.clusters # Filter by workspace - query = query.where("ARRAY[?] && team_ids", team_ids.to_a.map(&:to_i)) unless team_ids.blank? + query = query.where.not("ARRAY[?] && team_ids", self.team_ids - team_ids.to_a.map(&:to_i)) if !team_ids.blank? && team_ids != self.team_ids query = query.where(team_ids: []) if team_ids&.empty? # Invalidate the query # Filter by channel