Skip to content

Commit

Permalink
Fixing: Adding missing language filter for explainers. (#2236)
Browse files Browse the repository at this point in the history
Reference: CV2-5007.
  • Loading branch information
caiosba authored Feb 26, 2025
1 parent 92f54f5 commit 9ae13a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ def filtered_explainers(filters = {})
# Filter by text
query = self.filter_by_keywords(query, filters, 'Explainer') if filters[:text].to_s.size > 2

# Filter by language
query = query.where('explainers.language' => filters[:language].to_a) unless filters[:language].blank?

# Exclude the ones already applied to a target item
target = ProjectMedia.find_by_id(filters[:target_id].to_i)
query = query.where.not(id: target.explainer_ids) unless target.nil?
Expand Down

0 comments on commit 9ae13a4

Please sign in to comment.