Changing return of Model::deleteAll(). When no records are matched by the delete conditions return is now (bool)true as no records matching those conditions exist.

Test case added.
Fixes #6453

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8216 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mark_story 2009-07-03 00:26:58 +00:00
parent f79a68b2a6
commit 45a51ed809
2 changed files with 4 additions and 1 deletions

View file

@ -1811,7 +1811,7 @@ class Model extends Overloadable {
);
if (empty($ids)) {
return false;
return true;
}
if ($callbacks) {

View file

@ -7487,6 +7487,9 @@ class ModelTest extends CakeTestCase {
'published' => 'Y'
)));
$this->assertEqual($result, $expected);
$result = $TestModel->deleteAll(array('Article.user_id' => 999));
$this->assertTrue($result, 'deleteAll returned false when all no records matched conditions. %s');
}
/**
* testRecursiveDel method