Modified models in models.php setting the with key since these models are not used unless the with key is defined in the association.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7740 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2008-10-13 01:17:34 +00:00
parent f139b0312f
commit 4c2a3ee02f
2 changed files with 3 additions and 2 deletions

View file

@ -618,9 +618,9 @@ class Model extends Overloadable {
function __generateAssociation($type) {
foreach ($this->{$type} as $assocKey => $assocData) {
$class = $assocKey;
$dynamicWith = false;
foreach ($this->__associationKeys[$type] as $key) {
$dynamicWith = false;
if (!isset($this->{$type}[$assocKey][$key]) || $this->{$type}[$assocKey][$key] === null) {
$data = '';

View file

@ -1023,6 +1023,7 @@ class Node extends CakeTestModel{
'ParentNode' => array(
'className' => 'Node',
'joinTable' => 'dependency',
'with' => 'Dependency',
'foreignKey' => 'child_id',
'associationForeignKey' => 'parent_id',
)
@ -2335,7 +2336,7 @@ class Content extends CakeTestModel {
* @var array
* @access public
*/
var $hasAndBelongsToMany = array('Account' => array('className' => 'Account', 'joinTable' => 'ContentAccounts', 'foreignKey' => 'iContentId', 'associationForeignKey', 'iAccountId'));
var $hasAndBelongsToMany = array('Account' => array('className' => 'Account', 'with' => 'ContentAccount', 'joinTable' => 'ContentAccounts', 'foreignKey' => 'iContentId', 'associationForeignKey', 'iAccountId'));
}
/**
* Nonconformant Account class