d8220395c8
Update app/components/dossiers/errors_full_messages.rb Update app/components/dossiers/errors_full_messages/errors_full_messages.html.haml Co-authored-by: Colin Darie <colin@darie.eu>
11 lines
245 B
Ruby
11 lines
245 B
Ruby
require 'iban-tools'
|
|
|
|
class IbanValidator < ActiveModel::Validator
|
|
def validate(record)
|
|
if record.value.present?
|
|
unless IBANTools::IBAN.valid?(record.value)
|
|
record.errors.add :value, :invalid_iban
|
|
end
|
|
end
|
|
end
|
|
end
|