2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-09-25 10:32:08 -05:00
|
|
|
class UserFieldSerializer < ApplicationSerializer
|
2014-10-08 13:38:18 -05:00
|
|
|
attributes :id,
|
|
|
|
:name,
|
|
|
|
:description,
|
|
|
|
:field_type,
|
|
|
|
:editable,
|
2015-01-29 16:38:39 -06:00
|
|
|
:required,
|
2015-07-28 11:29:40 -05:00
|
|
|
:show_on_profile,
|
2016-04-08 07:35:41 -05:00
|
|
|
:show_on_user_card,
|
2021-04-27 00:52:45 -05:00
|
|
|
:searchable,
|
2015-07-30 13:52:53 -05:00
|
|
|
:position,
|
2015-07-28 11:29:40 -05:00
|
|
|
:options
|
|
|
|
|
|
|
|
def options
|
|
|
|
object.user_field_options.pluck(:value)
|
|
|
|
end
|
|
|
|
|
|
|
|
def include_options?
|
|
|
|
options.present?
|
|
|
|
end
|
2014-09-25 10:32:08 -05:00
|
|
|
end
|