diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 3ddd1871c..198063891 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -446,10 +446,7 @@ class DboSource extends DataSource { */ function fullTableName($model, $quote = true) { if (is_object($model)) { - $table = $model->table; - if ($model->tablePrefix != null && !empty($model->tablePrefix)) { - $table = $model->tablePrefix . $table; - } + $table = $model->tablePrefix . $model->table; } elseif (isset($this->config['prefix'])) { $table = $this->config['prefix'] . strval($model); } else { diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index a5ee109ff..f0da7e3b0 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1924,7 +1924,7 @@ class Model extends Overloadable { } $db =& ConnectionManager::getDataSource($this->useDbConfig); - if (!empty($db->config['prefix']) && $this->tablePrefix !== false) { + if (!empty($db->config['prefix']) && $this->tablePrefix === null) { $this->tablePrefix = $db->config['prefix']; }