class CrazyValidators::AlphaNumericalityValidator

Public Instance Methods

validate_each(record, attribute, value) click to toggle source
# File lib/crazy_validators/alpha_numericality_validator.rb, line 5
def validate_each(record, attribute, value)
  
  return if value.nil?
  
  unless value.to_s.match(/^\w+$/)
    record.errors.add(attribute, :not_alpha_numeric, options)
  end
end