demarches-normaliennes/app/models/columns/dossier_column.rb
Christophe Robillard f383e1c502
prepare export template to be used for tabular template
Co-authored-by: mfo <mfo@users.noreply.github.com>
2024-11-14 14:45:40 +01:00

20 lines
506 B
Ruby

# frozen_string_literal: true
class Columns::DossierColumn < Column
def value(dossier)
case table
when 'self'
dossier.public_send(column)
when 'etablissement'
dossier.etablissement.public_send(column)
when 'individual'
dossier.individual.public_send(column)
when 'groupe_instructeur'
dossier.groupe_instructeur.label
when 'followers_instructeurs'
dossier.followers_instructeurs.map(&:email).join(' ')
end
end
def dossier_column? = true
end