2017-12-11 15:15:03 +01:00
|
|
|
class IndividualSerializer < ActiveModel::Serializer
|
2018-05-30 15:25:16 +02:00
|
|
|
attribute :gender, key: :civilite
|
2017-12-11 15:15:03 +01:00
|
|
|
attributes :nom, :prenom
|
2018-05-30 15:25:16 +02:00
|
|
|
attribute :birthdate, key: :date_naissance, if: :include_birthdate?
|
|
|
|
|
|
|
|
def include_birthdate?
|
|
|
|
object&.dossier&.procedure&.ask_birthday
|
|
|
|
end
|
2017-12-11 15:15:03 +01:00
|
|
|
end
|