Browse Source

Actually making all tests pass

Jose Lorenzo Rodriguez 12 years ago
parent
commit
5664ab4b2c
2 changed files with 5 additions and 0 deletions
  1. 1 0
      src/ORM/EagerLoader.php
  2. 4 0
      src/ORM/Query.php

+ 1 - 0
src/ORM/EagerLoader.php

@@ -67,6 +67,7 @@ class EagerLoader {
 	public function contain($associations = null, $override = false) {
 		if ($this->_containments === null || $override) {
 			$this->_containments = new \ArrayObject;
+			$this->_normalized = null;
 		}
 
 		if ($associations === null) {

+ 4 - 0
src/ORM/Query.php

@@ -307,6 +307,10 @@ class Query extends DatabaseQuery {
  * @return \ArrayObject|Query
  */
 	public function contain($associations = null, $override = false) {
+		if (empty($associations) && $override) {
+			$this->_eagerLoader = null;
+		}
+
 		$result = $this->eagerLoader()->contain($associations, $override);
 		if ($associations !== null || $override) {
 			$this->_dirty();