mirror of
https://github.com/discourse/discourse.git
synced 2024-12-18 16:13:45 +08:00
e29605b79f
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.
24 lines
476 B
Ruby
24 lines
476 B
Ruby
# frozen_string_literal: true
|
|
|
|
class UserFieldSerializer < ApplicationSerializer
|
|
attributes :id,
|
|
:name,
|
|
:description,
|
|
:field_type,
|
|
:editable,
|
|
:required,
|
|
:show_on_profile,
|
|
:show_on_user_card,
|
|
:searchable,
|
|
:position,
|
|
:options
|
|
|
|
def options
|
|
object.user_field_options.pluck(:value)
|
|
end
|
|
|
|
def include_options?
|
|
options.present?
|
|
end
|
|
end
|