discourse/app/serializers/user_field_serializer.rb
Thorben Egberts cf8b3fbd56 FEATURE: add user custom fields to user card
The user's custom fields are now displayed on the user card. This has to be enabled for each custom field in the custom field settings. See https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/
2016-04-08 14:35:41 +02:00

20 lines
419 B
Ruby

class UserFieldSerializer < ApplicationSerializer
attributes :id,
:name,
:description,
:field_type,
:editable,
:required,
:show_on_profile,
:show_on_user_card,
:position,
:options
def options
object.user_field_options.pluck(:value)
end
def include_options?
options.present?
end
end