demarches-normaliennes/app/serializers/individual_serializer.rb

10 lines
267 B
Ruby
Raw Normal View History

class IndividualSerializer < ActiveModel::Serializer
attribute :gender, key: :civilite
attributes :nom, :prenom
attribute :birthdate, key: :date_naissance, if: :include_birthdate?
def include_birthdate?
object&.dossier&.procedure&.ask_birthday
end
end