Best Practice: one to one relational save operation

Hi Guys, First post here, although lurking for a while. Hi to ALL!!!!

have a model (venue) that has the following relation:

‘address’=>array(self::HAS_ONE, ‘address’, ‘venueId’)

Have public definition for each column in table:address declared in venue modal, have declared as safeAttributes and have sorted out the view/s with form inputs to allow entry for each address variable!

Now my question:

I have implemented the logic of the one to one relationship via a hard coded SQL INSERT createcommand within the afterSave function of model Venue. This works ok, however I am wondering if it is possible to wrap up the creation of both the addition of row to table venue and to table address with the actionCreate function in the controller?

Surely the only way to implement all relational creations is not through createCommands!?!?

Cheers in advance for helping me with my first post!

Address should also be an ActiveRecord thus you can call $address->venueid = <id>; $address->save();

ah Dave, of course!!!

So is aftersave within the Venue Model still the best place to do the address parameter assigning and save()???