Merging fixes to trunk

Revision: [1775]
Fixed error in hasOne associations


git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1776 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-01-12 18:34:16 +00:00
parent dd3de20200
commit 83d00fc93a

View file

@ -451,10 +451,9 @@ class DboSource extends DataSource
$sql = ' LEFT JOIN '.$this->name($linkModel->table);
$sql .= ' AS '.$this->name($alias).' ON '.$this->name($alias).'.';
$sql .= $this->name($assocData['foreignKey']).'='.$model->escapeField($model->primaryKey);
$sql .= $this->conditions($assocData['conditions']);
$sql .= $this->order($assocData['order']);
if (!in_array($queryData['joins'], $sql))
if (!in_array($sql, $queryData['joins']))
{
$queryData['joins'][] = $sql;
}