demarches-normaliennes/app/models/champs/integer_number_champ.rb
2018-11-29 15:12:31 +01:00

7 lines
183 B
Ruby

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