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

8 lines
164 B
Ruby
Raw Normal View History

2018-10-31 19:48:28 +01:00
class Champs::IntegerNumberChamp < Champ
validates :value, numericality: { only_integer: true, allow_nil: true }
def value_for_export
value.to_i
end
end