demarches-normaliennes/app/models/champs/dossier_link_champ.rb
2023-08-02 11:43:23 +02:00

11 lines
239 B
Ruby

class Champs::DossierLinkChamp < Champ
validate :value_integerable, if: -> { value.present? }, on: :prefill
private
def value_integerable
Integer(value)
rescue ArgumentError
errors.add(:value, :not_integerable)
end
end