Skip to content

Commit

Permalink
Use prefix matching in contributor and organization filtering.
Browse files Browse the repository at this point in the history
Signed-off-by: EdmondFrank <[email protected]>
  • Loading branch information
EdmondFrank committed Feb 22, 2024
1 parent 234b142 commit 3562fb2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/concerns/contributor_enrich.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def filter_contributors(contributors, filter_opts)
contributors
.select { |row| !(filter_opt.values & row['contribution_type_list'].map{|c| c['contribution_type']}).empty? }
.map { |row| append_filtered_contribution(row, filter_opt) }
elsif filter_opt.type == 'contributor' || filter_opt.type == 'organization'
contributors.select { |row| filter_opt.values.any? { |value| row[filter_opt.type].starts_with?(value) } }
else
contributors.select { |row| filter_opt.values.include?(row[filter_opt.type]) }
end
Expand Down

0 comments on commit 3562fb2

Please sign in to comment.