discourse/app/serializers/user_field_serializer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
546 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class UserFieldSerializer < ApplicationSerializer
attributes :id,
:name,
:description,
:field_type,
:editable,
:required,
:requirement,
:show_on_profile,
:show_on_user_card,
:searchable,
2015-07-30 14:52:53 -04:00
:position,
:options
def required
object.required?
end
def options
object.user_field_options.pluck(:value)
end
def include_options?
options.present?
end
end