mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 03:08:23 +08:00
FEATURE: the ability to search users by custom fields (#12762)
When the admin creates a new custom field they can specify if that field should be searchable or not. That setting is taken into consideration for quick search results.
This commit is contained in:

committed by
GitHub

parent
8aeeadd8b0
commit
e29605b79f
@ -2,6 +2,8 @@
|
||||
|
||||
class UserCustomField < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
|
||||
scope :searchable, -> { joins("INNER JOIN user_fields ON user_fields.id = REPLACE(user_custom_fields.name, 'user_field_', '')::INTEGER AND user_fields.searchable IS TRUE AND user_custom_fields.name like 'user_field_%'") }
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
|
Reference in New Issue
Block a user