Browse Source

All tests passing now

Jose Lorenzo Rodriguez 12 years ago
parent
commit
fba68dcdee
1 changed files with 6 additions and 7 deletions
  1. 6 7
      src/ORM/EagerLoader.php

+ 6 - 7
src/ORM/EagerLoader.php

@@ -233,14 +233,14 @@ class EagerLoader {
 		];
 		$config['canBeJoined'] = $instance->canBeJoined($config['config']);
 
-		if (!$config['canBeJoined']) {
-			$this->_loadEagerly[$alias] = $config;
-		}
-
 		foreach ($extra as $t => $assoc) {
 			$config['associations'][$t] = $this->_normalizeContain($table, $t, $assoc);
 		}
 
+		if (!$config['canBeJoined']) {
+			$this->_loadEagerly[$alias] = $config;
+		}
+
 		return $config;
 	}
 
@@ -263,9 +263,8 @@ class EagerLoader {
 	}
 
 /**
- * Helper method that will calculate those associations that cannot be joined
- * directly in this query and will setup the required extra queries for fetching
- * the extra data.
+ * Decorates the passed statement object in order to inject data form associations
+ * that cannot be joined directly.
  *
  * @param \Cake\ORM\Query $query The query for which to eage load external
  * associations