demarches-normaliennes/app/models/champs/yes_no_champ.rb
2018-11-06 16:59:47 +01:00

17 lines
243 B
Ruby

class Champs::YesNoChamp < Champs::CheckboxChamp
def search_terms
if value == 'true'
[ libelle ]
end
end
def to_s
value_for_export
end
private
def value_for_export
value == 'true' ? 'oui' : 'non'
end
end