Skip to content

Commit

Permalink
Fix cachefiles being generated with "
Browse files Browse the repository at this point in the history
Cache files with SQLite should not contain "

Fixes #2323
  • Loading branch information
markstory committed Dec 1, 2011
1 parent 65b87af commit 49708ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Sqlite.php
Expand Up @@ -165,7 +165,7 @@ public function describe($model) {
if ($cache != null) {
return $cache;
}
$table = $this->fullTableName($model);
$table = $this->fullTableName($model, false);
$fields = array();
$result = $this->_execute('PRAGMA table_info(' . $table . ')');

Expand Down
7 changes: 7 additions & 0 deletions lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php
Expand Up @@ -262,6 +262,10 @@ public function testBuildColumn() {
public function testDescribe() {
$this->loadFixtures('User');
$Model = new Model(array('name' => 'User', 'ds' => 'test', 'table' => 'users'));

$this->Dbo->cacheSources = true;
Configure::write('Cache.disable', false);

$result = $this->Dbo->describe($Model);
$expected = array(
'id' => array(
Expand Down Expand Up @@ -300,6 +304,9 @@ public function testDescribe() {

$result = $this->Dbo->describe($Model->useTable);
$this->assertEquals($expected, $result);

$result = Cache::read('test_users', '_cake_model_');
$this->assertEquals($expected, $result);
}

/**
Expand Down

0 comments on commit 49708ec

Please sign in to comment.