Skip to content
Snippets Groups Projects
Unverified Commit 479c8397 authored by Hadi Cheaito's avatar Hadi Cheaito Committed by GitHub
Browse files

Adding email and role column search (#4036)

parent 044009b7
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ class User < ApplicationRecord
scope :with_provider, ->(current_provider) { where(provider: current_provider) }
def self.search(input)
return where('users.name ILIKE ?', "%#{input}%") if input
return joins(:role).where('users.name ILIKE :input OR users.email ILIKE :input OR roles.name ILIKE :input', input: "%#{input}%") if input
all
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment