Fixing issue #2735, deleteAll() does not work correctly with model aliases

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5323 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2007-06-21 15:40:03 +00:00
parent 172f9817cb
commit b870ea170c

View file

@ -1271,7 +1271,9 @@ class DboSource extends DataSource {
$table = $this->fullTableName($model);
$conditions = $this->conditions($query);
if ($this->execute("DELETE FROM {$table} {$conditions}") === false) {
$alias = $this->alias . $this->name($model->name);
if ($this->execute("DELETE FROM {$table} {$alias} {$conditions}") === false) {
$model->onError();
return false;
}