demarches-normaliennes/app/serializers/individual_serializer.rb
2024-08-22 09:26:48 +02:00

11 lines
318 B
Ruby

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