Skip to content

Commit

Permalink
add filter to users
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiomagalhaes committed Dec 10, 2024
1 parent 3f1b14e commit 09e36a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ def index
end

if skills_filter.present?
@users = @users.joins(:skills).where('LOWER(skills.name) LIKE ANY (ARRAY[?])', skills_filter.map { |s| "%#{s}%" })
@users = @users.joins(:skills)
.where('LOWER(skills.name) LIKE ANY (ARRAY[?])', skills_filter.map { |s| "%#{s}%" })
.distinct
end

@users = @users.where(internal: true) if only_internal.present?
Expand Down

0 comments on commit 09e36a8

Please sign in to comment.