forked from External/greenlight
GRN2-310: Share Access now dynamically pulls the list of users from the server (#2380)
* Share Access now dynamically pulls the list of users from the server * Merge users now dynamically pulls the list of users from the server * Only return the information needed to the front-end
This commit is contained in:
@ -95,6 +95,24 @@ class User < ApplicationRecord
|
||||
order(Arel.sql("users.#{column} #{direction}"))
|
||||
end
|
||||
|
||||
def self.shared_list_search(string)
|
||||
return all if string.blank?
|
||||
|
||||
search_query = "users.name LIKE :search OR users.uid LIKE :search"
|
||||
|
||||
search_param = "%#{sanitize_sql_like(string)}%"
|
||||
where(search_query, search: search_param)
|
||||
end
|
||||
|
||||
def self.merge_list_search(string)
|
||||
return all if string.blank?
|
||||
|
||||
search_query = "users.name LIKE :search OR users.email LIKE :search"
|
||||
|
||||
search_param = "%#{sanitize_sql_like(string)}%"
|
||||
where(search_query, search: search_param)
|
||||
end
|
||||
|
||||
# Returns a list of rooms ordered by last session (with nil rooms last)
|
||||
def ordered_rooms
|
||||
return [] if main_room.nil?
|
||||
|
Reference in New Issue
Block a user