As you can see from the cookbook
profile.user_id should define hasOne and post.user_id should define hasMany.
There is no way the "./cake bake all" can distinguish these two so by
default its hasMany.
If you want to define hasOne set it manually or bake the model step by step
and choose user hasOne reference.

I think that if you defined a unique index on profile.user_id and aforeign
key cake should use hasOne.
But it doesn't.


On Fri, May 14, 2010 at 8:55 PM, bradmaxs <[email protected]> wrote:

> Thank you both for your responses.
>
> I ended up changing the association, cleared my cache and it works
> like a charm.
>
> Quick question. I used the command line to bake everything.  The
> user_preference table has user_id in it for the association.
>
> Why did bake make it a hasMany association rather than hasOne? Did I
> miss something when I baked the models?
>
> Thanks again.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Regards,
Zaky Katalan-Ezra
QA Administrator
www.IGeneriX.com
Sites.IGeneriX.com
054-7762312

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to