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