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:
Krzysztof Kotlarek
2021-04-27 15:52:45 +10:00
committed by GitHub
parent 8aeeadd8b0
commit e29605b79f
16 changed files with 154 additions and 19 deletions

View File

@ -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