Skip to content

Commit

Permalink
Inverting the logic of the feed workspace filter for clusters (#1887)
Browse files Browse the repository at this point in the history
It should exclude unselected workspaces, instead of returning clusters with all other selected workspaces.

Fixes CV2-4601.
  • Loading branch information
caiosba committed May 10, 2024
1 parent 98f60fe commit be277ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit be277ba

Please sign in to comment.