updating db connection setting for model task

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5704 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-09-30 20:47:37 +00:00
parent 7aa5dfad0e
commit 08b690d196

View file

@ -69,12 +69,7 @@ class ModelTask extends Shell {
$primaryKey = 'id';
$validate = array();
$associations = array('belongsTo'=> array(), 'hasOne'=> array(), 'hasMany', 'hasAndBelongsToMany'=> array());
$usingDefault = $this->in('Will your model be using a database connection setting other than the default?');
$useDbConfig = 'default';
if (low($usingDefault) == 'y' || low($usingDefault) == 'yes') {
$useDbConfig = $this->in('Please provide the name of the connection you wish to use.');
}
$useDbConfig = $this->in('Database Connection:', null, 'default');
$currentModelName = $this->getName($useDbConfig);
$db =& ConnectionManager::getDataSource($useDbConfig);