Alter Model::exists() to return false with no table

This commit is contained in:
James Tancock 2015-08-18 13:07:30 +01:00
parent 2f7cc052d2
commit fdb41e01bb
2 changed files with 2 additions and 2 deletions

View file

@ -2896,7 +2896,7 @@ class Model extends Object implements CakeEventListener {
} }
if ($this->useTable === false) { if ($this->useTable === false) {
return true; return false;
} }
return (bool)$this->find('count', array( return (bool)$this->find('count', array(

View file

@ -2787,7 +2787,7 @@ class ModelWriteTest extends BaseModelTest {
$this->assertFalse($TestModel->exists()); $this->assertFalse($TestModel->exists());
$TestModel->id = 5; $TestModel->id = 5;
$this->assertTrue($TestModel->exists()); $this->assertFalse($TestModel->exists());
} }
/** /**