demarches-normaliennes/app/models/champs/integer_number_champ.rb
2018-11-06 11:28:44 +01:00

7 lines
164 B
Ruby

class Champs::IntegerNumberChamp < Champ
validates :value, numericality: { only_integer: true, allow_nil: true }
def value_for_export
value.to_i
end
end