ソースを参照

another bulletproofing for schemaless baking

AD7six 14 年 前
コミット
adf73abb07
1 ファイル変更5 行追加1 行削除
  1. 5 1
      lib/Cake/Console/Command/Task/ModelTask.php

+ 5 - 1
lib/Cake/Console/Command/Task/ModelTask.php

@@ -669,7 +669,11 @@ class ModelTask extends BakeTask {
 			$className = $this->in(__d('cake_console', 'What className will %s use?', $alias), null, $alias );
 
 			if ($assocType == 0) {
-				$showKeys = $possibleKeys[$model->table];
+				if (!empty($possibleKeys[$model->table])) {
+					$showKeys = $possibleKeys[$model->table];
+				} else {
+					$showKeys = null;
+				}
 				$suggestedForeignKey = $this->_modelKey($alias);
 			} else {
 				$otherTable = Inflector::tableize($className);