demarches-normaliennes/app/models/champs/yes_no_champ.rb

22 lines
283 B
Ruby
Raw Normal View History

2018-02-13 18:18:20 +01:00
class Champs::YesNoChamp < Champs::CheckboxChamp
def search_terms
if value == 'true'
[libelle]
end
end
2018-11-06 16:20:11 +01:00
def to_s
processed_value
end
def for_export
processed_value
2018-11-06 16:20:11 +01:00
end
private
def processed_value
value == 'true' ? 'oui' : 'non'
end
2018-02-13 18:18:20 +01:00
end