discourse/app/serializers/user_field_serializer.rb

19 lines
362 B
Ruby
Raw Normal View History

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