To do it in model:
class User extends AppModel {
var $name = 'User';
var $useDbConfig = 'general_syst';
function __construct($id = false, $table = null, $ds = null) {
$this->useDbConfig = 'db1';
parent::__construct($id, $table, $ds);
}
// your code here
// ....
}
When in controller
class Users extends AppController {
function action1(){
$this->User->useDbConfig = 'db1';
$users = $this->User->find('all');
// your code here
// ....
}
}
Hope this one helps.