Introduce permanent and customizable procedure url

This commit is contained in:
Guillaume Lazzara 2016-06-24 16:41:44 +02:00
parent b68b62b8f0
commit e5002dbb11
27 changed files with 5164 additions and 49 deletions

View file

@ -0,0 +1,16 @@
class ProcedurePathFormatValidator < ActiveModel::Validator
def path_regex
/^[a-z0-9_]{3,30}$/
end
def validate(record)
return false if record.path.blank?
record.errors[:path] << "Path invalide" unless path_regex.match(record.path)
end
def validate_string(path)
return false if path.blank?
path_regex.match(path)
end
end