class UcNumberValidator
Provides AR validations for UC Student Numbers.
Public Instance Methods
validate_each(record, attribute, value)
click to toggle source
# File lib/ar_validator.rb, line 5 def validate_each(record, attribute, value) unless value.is_a?(String) && value.valid_uc_number? record.errors[attribute] << options[:message] || 'is not a valid uc number' end end