class ActiveModel::Validations::BankRoutingNumberFormatValidator
Public Instance Methods
validate_each(object, attribute, value)
click to toggle source
# File lib/format_validator/bank_routing_number_format_validator.rb, line 4 def validate_each(object, attribute, value) unless value.to_s.match /\A\d{9}\z/ object.errors[attribute] << (options[:message] || I18n.t('form.errors.bank_routing_number')) end end