mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:29:30 +08:00
19 lines
362 B
Ruby
19 lines
362 B
Ruby
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
|