Do one thing per line

This commit is contained in:
gregoirenovel 2018-10-01 13:24:37 +02:00
parent 8a55fba127
commit b994fa4206
26 changed files with 186 additions and 62 deletions

View file

@ -4,7 +4,12 @@ class ProcedurePathFormatValidator < ActiveModel::Validator
end
def validate(record)
return false if record.path.blank?
record.errors[:path] << "Path invalide" if !path_regex.match(record.path)
if record.path.blank?
return false
end
if !path_regex.match(record.path)
record.errors[:path] << "Path invalide"
end
end
end