Fixing saveMany

This commit is contained in:
Christian Winther 2012-05-09 23:59:02 +02:00
parent b4a42e4a03
commit e8fce37a65

View file

@ -2117,6 +2117,7 @@ class Model extends Object implements CakeEventListener {
} else {
$validates = $this->create($record) && $this->validates($options);
}
$data[$key] = $this->data;
if ($validates === false || (is_array($validates) && in_array(false, $validates, true))) {
$validationErrors[$key] = $this->validationErrors;
$validates = false;
@ -2125,6 +2126,7 @@ class Model extends Object implements CakeEventListener {
}
$return[$key] = $validates;
}
$this->data = $data;
$this->validationErrors = $validationErrors;
if (!$options['atomic']) {
return $return;