class RoutingNumberValidator

Public Instance Methods

validate_each(record, attribute, value) click to toggle source
# File lib/active_model/routing_number_validator.rb, line 3
def validate_each(record, attribute, value)
  record_error(record, attribute, value) unless BankValidator::RoutingNumber.new(value).valid?
end

Private Instance Methods

record_error(record, attribute, value) click to toggle source
# File lib/active_model/routing_number_validator.rb, line 9
def record_error(record, attribute, value)
  record.errors.add(attribute, (options[:message] || :invalid_routing_number))
end