Skip to content

Commit

Permalink
Assign before actually using it.
Browse files Browse the repository at this point in the history
  • Loading branch information
bar committed Nov 12, 2013
1 parent 0265650 commit 67a6566
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -1606,13 +1606,13 @@ public function generateAssociationQuery(Model $Model, $linkModel, $type, $assoc
switch ($type) {
case 'hasOne':
case 'belongsTo':
$self = ($Model->name === $linkModel->name);

$conditions = $this->_mergeConditions(
$assocData['conditions'],
$this->getConstraint($type, $Model, $linkModel, $association, array_merge($assocData, compact('external', 'self')))
);

$self = ($Model->name === $linkModel->name);

if (!$self && $external) {
$modelAlias = $Model->alias;
foreach ($conditions as $key => $condition) {
Expand Down

0 comments on commit 67a6566

Please sign in to comment.