Skip to content

Commit

Permalink
Be more semantic indicating that association fields must be empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
bar committed Dec 21, 2013
1 parent 99c8503 commit 8355d32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -1046,11 +1046,11 @@ public function read(Model $Model, $queryData = array(), $recursive = null) {
$Model->recursive = $recursive;
}

$bypass = false;
if (!empty($queryData['fields'])) {
$bypass = true;
$noAssocFields = true;
$queryData['fields'] = $this->fields($Model, null, $queryData['fields']);
} else {
$noAssocFields = false;
$queryData['fields'] = $this->fields($Model);
}

Expand All @@ -1076,7 +1076,7 @@ public function read(Model $Model, $queryData = array(), $recursive = null) {
continue;
}

if ($bypass) {
if ($noAssocFields) {
$assocData['fields'] = false;
}

Expand Down

0 comments on commit 8355d32

Please sign in to comment.