Making saveAll() behave like plain save() when suplied empty data array, closes #277

This commit is contained in:
José Lorenzo Rodríguez 2010-03-17 15:19:30 -04:30
parent 8375570f8a
commit 5c186d4430
2 changed files with 23 additions and 0 deletions

View file

@ -1584,6 +1584,11 @@ class Model extends Overloadable {
$validates = true;
$return = array();
if (empty($data) && $options['validate'] !== false) {
$result = $this->save($data, $options);
return !empty($result);
}
if ($options['atomic'] && $options['validate'] !== 'only') {
$db->begin($this);
}