Re: HABTM Relationship and Multiple Models

2008-07-10 Thread lirc201
I finally figured it out or at least one way of doing it. Step 1 - Unbind the HABTM with the Associate model Step 2 - Save User model data Step 3 - bind HABTM with Associate model Step 4 - save data['User']['id'] = getLastInsertID <- for the automagic to happen!!! Step 5 - Save Associate data T

Re: HABTM Relationship and Multiple Models

2008-07-02 Thread lirc201
What is the "with" option? On Jul 2, 1:30 pm, francky06l <[EMAIL PROTECTED]> wrote: > If you use a join model (ie: HABTM) using 'with' option, the saveAll > will work if you also save the Associate (saving User, Associate and > the with Model). > If you do not have the Associate to save, just unb

Re: HABTM Relationship and Multiple Models

2008-07-02 Thread francky06l
If you use a join model (ie: HABTM) using 'with' option, the saveAll will work if you also save the Associate (saving User, Associate and the with Model). If you do not have the Associate to save, just unbind and bind as hasMany your liked model (the with), and call saveAll... hth On Jul 2, 6:28

Re: HABTM Relationship and Multiple Models

2008-07-02 Thread James K
It's best to just make a model for your join table, populate it manually and save it separately. There is an "automagic" way to do it - which is described in the manual - but it's just as much work and not very intuitive. The way the automagic works is you have to add an array of Associate keys yo

HABTM Relationship and Multiple Models

2008-07-01 Thread lirc201
Hello All, I'm stuck and need a jump start here. I have a form that collections User model and Associate model data. User like email, password and Associate like street, city, state, etc... data. I have a HABTM relationship between User and Associate. My question is how to make the linkage w