Skip to content
Permalink
Browse files

Let nested validator know if current context is create or update

  • Loading branch information...
Andreas Kristiansen
Andreas Kristiansen committed Nov 2, 2015
1 parent a448f49 commit 5b7d8bcbae215118e55da6a284ff82d4e786a558
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Validation/Validator.php
@@ -347,7 +347,7 @@ public function addNested($field, Validator $validator)
foreach ($this->providers() as $provider) {
$validator->provider($provider, $this->provider($provider));
}
$errors = $validator->errors($value);
$errors = $validator->errors($value, $context['newRecord']);
return empty($errors) ? true : $errors;
}]);
return $this;
@@ -385,7 +385,7 @@ public function addNestedMany($field, Validator $validator)
if (!is_array($row)) {
return false;
}
$check = $validator->errors($row);
$check = $validator->errors($row, $context['newRecord']);
if (!empty($check)) {
$errors[$i] = $check;
}

0 comments on commit 5b7d8bc

Please sign in to comment.
You can’t perform that action at this time.