Skip to content

Commit

Permalink
Alter Model::exists() to return false with no table
Browse files Browse the repository at this point in the history
  • Loading branch information
tanuck committed Aug 18, 2015
1 parent 2f7cc05 commit fdb41e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2896,7 +2896,7 @@ public function exists($id = null) {
}

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

return (bool)$this->find('count', array(
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Model/ModelWriteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2787,7 +2787,7 @@ public function testRecordExists() {
$this->assertFalse($TestModel->exists());

$TestModel->id = 5;
$this->assertTrue($TestModel->exists());
$this->assertFalse($TestModel->exists());
}

/**
Expand Down

0 comments on commit fdb41e0

Please sign in to comment.