another update for bake model validations

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6584 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-03-16 06:07:16 +00:00
parent a6fbe05964
commit aac0cecf49

View file

@ -256,7 +256,7 @@ class ModelTask extends Shell {
}
}
$methods = array_flip($choices);
$prompt .= "{$skip} - Do not do any validation on this field.\n";
$prompt .= "... or enter in a valid regex validation string.\n";
@ -282,7 +282,7 @@ class ModelTask extends Shell {
$choice = $guess;
}
if ($choice !== $skip) {
if (is_numeric($choice) && isset($options[$choice])) {
if (is_numeric($choice) && isset($choices[$choice])) {
$validate[$fieldName] = $choices[$choice];
} else {
$validate[$fieldName] = $choice;