discourse/app/serializers/user_field_serializer.rb

Failed to ignore revisions in .git-blame-ignore-revs.

23 lines
450 B
Ruby
Raw Normal View History

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