2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

FIX: Group.search should look up Group#full_name too.

https://meta.discourse.org/t/mentioning-group-by-full-name-doesnt-work/63437/3
This commit is contained in:
Guo Xiang Tan 2017-06-29 16:36:51 +09:00
parent 7b35c55a1e
commit 5e156fbe85
2 changed files with 17 additions and 1 deletions

View file

@ -282,7 +282,9 @@ class Group < ActiveRecord::Base
end
def self.search_group(name)
Group.where(visible: true).where("name ILIKE :term_like", term_like: "#{name}%")
Group.where(visible: true).where(
"name ILIKE :term_like OR full_name ILIKE :term_like", term_like: "#{name}%"
)
end
def self.lookup_group(name)