Browse Source

Merge pull request #4730 from cakephp/issue-4143

Flush TableRegistry when generating controllers/models.
José Lorenzo Rodríguez 11 years ago
parent
commit
def2090f4e
2 changed files with 2 additions and 0 deletions
  1. 1 0
      src/Shell/Task/ControllerTask.php
  2. 1 0
      src/Shell/Task/ModelTask.php

+ 1 - 0
src/Shell/Task/ControllerTask.php

@@ -67,6 +67,7 @@ class ControllerTask extends BakeTask {
  */
 	public function all() {
 		foreach ($this->listAll() as $table) {
+			TableRegistry::clear();
 			$this->main($table);
 		}
 	}

+ 1 - 0
src/Shell/Task/ModelTask.php

@@ -129,6 +129,7 @@ class ModelTask extends BakeTask {
 			if (in_array($table, $this->skipTables)) {
 				continue;
 			}
+			TableRegistry::clear();
 			$this->main($table);
 		}
 	}