From 0c9023fd1d40d877227764a0a570f9e84eeb6049 Mon Sep 17 00:00:00 2001 From: gwoo Date: Sun, 16 Mar 2008 04:59:40 +0000 Subject: [PATCH] fix for bake model validations...thanks again, sdevore git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6580 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/console/libs/tasks/model.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index c096b540e..3081e8e2c 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -246,10 +246,13 @@ class ModelTask extends Shell { $prompt .= '---------------------------------------------------------------'."\n"; $prompt .= 'Please select one of the following validation options:'."\n"; $prompt .= '---------------------------------------------------------------'."\n"; + $choices = array(); $skip = 1; + sort($options); foreach ($options as $key => $option) { - if ($option{0} != '_') { - $prompt .= "{$key} - {$option}\n"; + if ($option{0} != '_' && strtolower($option) != 'getinstance') { + $prompt .= "{$skip} - {$option}\n"; + $choices[$skip] = $option; $skip++; } } @@ -279,7 +282,7 @@ class ModelTask extends Shell { } if ($choice !== $skip) { if (is_numeric($choice) && isset($options[$choice])) { - $validate[$fieldName] = $options[$choice]; + $validate[$fieldName] = $choices[$choice]; } else { $validate[$fieldName] = $choice; }