Do one thing per line
This commit is contained in:
parent
8a55fba127
commit
b994fa4206
26 changed files with 186 additions and 62 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue