Thank you for reporting this bug. We will make it our priority to review this report.
-
Sencha User
Can't have more than one association instance of the same model
Architect doesn't expose the associatedName config for associations, which causes the cached property to be "{ModelName}BelongsToInstance", creating a conflict when you want to association multiple models of the same type.
For now, I've overcome this by overriding the getInstanceName methods of the associations to use the associationKey, if it's available, i.e.:
Code:
Ext.define('Ext.data.association.override.BelongsTo', {
override: 'Ext.data.association.BelongsTo',
getInstanceName:function(){
var assKey = this.getAssociationKey();
return assKey ? assKey+'BelongsToInstance' : me.callParent();
}
});
-
-
Sencha User
Thanks for the tip! I must admit my eyes have skipped over that field for a while now. From looking at the code/docs, I think associatedName is the intended config variable for this, or possibly the fallback (instanceName isn't mentioned in the docs). I think this is still a low-priority bug for Architect, which should expose a config variable to prevent overlapping the "cache" keys.