Fixing Controller::generateFieldNames() when alias used in a HABTM

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4090 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-12-11 01:33:18 +00:00
parent 6ffdf09d4d
commit 3bc7ae19c2

View file

@ -757,7 +757,7 @@ class Controller extends Object {
}
foreach($modelObj->hasAndBelongsToMany as $associationName => $assocData) {
$otherModelKey = Inflector::underscore($associationName);
$otherModelKey = Inflector::underscore($assocData['className']);
$otherModelObj = &ClassRegistry::getObject($otherModelKey);
if ($doCreateOptions) {
$fieldNames[$otherModelKey]['model'] = $associationName;