PDA

View Full Version : automatically creating related association record



jmls
21 Jul 2012, 12:48 PM
I seem to be asking a lot of questions today ;)

If I have a Client model with an associated (hasOne) phone number model,

Client.Number_id

Number.id

and for ease of use I want to allow the automatically create the phone number if it does not exist when updating the client.

I can create the number, and sync the db. What I can't figure out is how to get hold of the new Number.id field to store in my client.Number_id

any hints ?

thanks