Avoid running validation again, when saveAll() is called with 'validate' => 'first'

This commit is contained in:
Ceeram 2012-04-16 09:45:44 +02:00
parent d136fac219
commit 9556ff714d

View file

@ -2044,7 +2044,7 @@ class Model extends Object implements CakeEventListener {
if ((!$validates && $options['atomic']) || (!$options['atomic'] && in_array(false, $validates, true))) { if ((!$validates && $options['atomic']) || (!$options['atomic'] && in_array(false, $validates, true))) {
return $validates; return $validates;
} }
$options['validate'] = true; $options['validate'] = false;
} }
if ($options['atomic']) { if ($options['atomic']) {
@ -2175,7 +2175,7 @@ class Model extends Object implements CakeEventListener {
if ((!$validates && $options['atomic']) || (!$options['atomic'] && in_array(false, $validates, true))) { if ((!$validates && $options['atomic']) || (!$options['atomic'] && in_array(false, $validates, true))) {
return $validates; return $validates;
} }
$options['validate'] = true; $options['validate'] = false;
} }
if ($options['atomic']) { if ($options['atomic']) {
$db = $this->getDataSource(); $db = $this->getDataSource();