Skip to content

Commit

Permalink
set schemaName for joinTable object in TranslateBehavior
Browse files Browse the repository at this point in the history
  • Loading branch information
rchavik committed Nov 25, 2011
1 parent 2048518 commit 813ecb6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Cake/Model/Behavior/TranslateBehavior.php
Expand Up @@ -102,6 +102,7 @@ public function beforeFind($model, $query) {
$joinTable = new StdClass();
$joinTable->tablePrefix = $tablePrefix;
$joinTable->table = $RuntimeModel->table;
$joinTable->schemaName = $RuntimeModel->getDataSource()->getSchemaName();

if (is_string($query['fields']) && 'COUNT(*) AS '.$db->name('count') == $query['fields']) {
$query['fields'] = 'COUNT(DISTINCT('.$db->name($model->alias . '.' . $model->primaryKey) . ')) ' . $db->alias . 'count';
Expand Down

0 comments on commit 813ecb6

Please sign in to comment.