Skip to content

Commit

Permalink
Alter model exists to consider useTable
Browse files Browse the repository at this point in the history
  • Loading branch information
tanuck committed Aug 16, 2015
1 parent 979820b commit 90a77f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Cake/Model/Model.php
Expand Up @@ -2895,6 +2895,10 @@ public function exists($id = null) {
return false;
}

if ($this->useTable === false) {
return true;
}

return (bool)$this->find('count', array(
'conditions' => array(
$this->alias . '.' . $this->primaryKey => $id
Expand Down

0 comments on commit 90a77f6

Please sign in to comment.