From 3610bd2064c5d9fe8b314b21a828c7f4e5af62c4 Mon Sep 17 00:00:00 2001 From: amartynov Date: Tue, 1 Dec 2015 17:16:11 +0300 Subject: [PATCH] CID-10: added '-' to name values --- devops-service/db/validators/field_validators/name.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devops-service/db/validators/field_validators/name.rb b/devops-service/db/validators/field_validators/name.rb index 4603934..3da7928 100644 --- a/devops-service/db/validators/field_validators/name.rb +++ b/devops-service/db/validators/field_validators/name.rb @@ -4,14 +4,14 @@ module Validators class Name < Base MAX_NAME_LEN = 200 - NAME_REGEX = /\A\w{1,#{MAX_NAME_LEN}}\z/ + NAME_REGEX = /\A[\w\-]{1,#{MAX_NAME_LEN}}\z/ def valid? !NAME_REGEX.match(@value).nil? end def message - "Invalid value '#{@value}': it should contains symbols 'a-zA-Z0-9_' and length should be more then 1 and less or equals then #{MAX_NAME_LEN} symbols" + "Invalid value '#{@value}': it should contains symbols 'a-zA-Z0-9_-' and length should be more then 1 and less or equals then #{MAX_NAME_LEN} symbols" end end end