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?
|
2019-08-22 17:58:31 +02:00
|
|
|
object&.dossier&.groupe_instructeur&.procedure&.ask_birthday
|
2018-05-30 15:25:16 +02:00
|
|
|
end
|
2017-12-11 15:15:03 +01:00
|
|
|
end
|