Updated Group model to search for sort by most member_count

• Updated:
- Group model to search for sort by most member_count
This commit is contained in:
mgabdev 2020-08-12 17:41:55 -05:00
parent 5fc517473f
commit f7bf7e2263

View File

@ -53,7 +53,7 @@ class Group < ApplicationRecord
pattern = sanitize_sql_like(term.strip) + '%' pattern = sanitize_sql_like(term.strip) + '%'
Group.where('lower(title) like lower(?) AND is_archived=false AND is_visible=true', pattern) Group.where('lower(title) like lower(?) AND is_archived=false AND is_visible=true', pattern)
.order(:title) .order('member_count DESC')
.limit(limit) .limit(limit)
.offset(offset) .offset(offset)
end end