class AlphanumericNameFormatValidator

Public Instance Methods

validate_each(object, attribute, value) click to toggle source
# File lib/ama_validators/alphanumeric_name_format_validator.rb, line 2
def validate_each(object, attribute, value)
  unless value =~ /\A[\s\da-zA-ZÀàÂâÄäÈèÉéÊêËëÎîÏïÔôŒœÙùÛûÜüŸÿÇç,.'\-\)\(]+\z/
    object.errors[attribute] << (options[:message] || "We're sorry your name cannot contain any special characters")
  end
end