# NamespaceNameValidator## Custom validator for GitLab namespace name strings.classNamespaceNameValidator<ActiveModel::EachValidatordefvalidate_each(record,attribute,value)unlessvalue=~Gitlab::Regex.namespace_name_regexrecord.errors.add(attribute,Gitlab::Regex.namespace_name_regex_message)endendend