GRN2-xx: Added a tab that displays invited users when using Join by Invitation (#2162)

* Added a tab that displays invited users when using Join by Invitation

* Made search work
This commit is contained in:
Ahmad Farhat
2020-10-07 11:23:19 -04:00
committed by GitHub
parent c80e215110
commit 5c79d37524
8 changed files with 216 additions and 130 deletions

View File

@ -20,4 +20,13 @@ class Invitation < ApplicationRecord
has_secure_token :invite_token
scope :valid, -> { where(updated_at: (Time.now - 48.hours)..Time.now) }
def self.admins_search(string)
return all if string.blank?
search_query = "email LIKE :search"
search_param = "%#{sanitize_sql_like(string)}%"
where(search_query, search: search_param)
end
end