another bulletproofing for schemaless baking

This commit is contained in:
AD7six 2011-11-20 16:08:01 +01:00
parent d2514f34c0
commit adf73abb07

View file

@ -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);