class NameFormatValidator

Public Instance Methods

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