In MySql create a constraint unique (instead of index) with the 2
fields, save will fail .. then you know.

On Apr 13, 12:20 am, Jeff <[email protected]> wrote:
> The validation in the join model I created is being ignored.  How can
> I go about debugging the validation?
>
> I have additional fields in the join table in addition to the IDs.
> The HABTM saves are so elegant that I'm hesitant to break them into
> hasManys.  In what ways is keeping it a HABTM limiting and at what
> point should I switch it to two hasManys instead?
>
> On Apr 12, 7:00 am, euromark <[email protected]> wrote:
>
> > yes
> > you can easily set up a model for it in order to validate
> > it won't destroy the HABTM relationship
>
> > depends on the use case
> > as soon as you need more that just the IDs it already starts to make
> > sense :)
>
> > On 12 Apr., 02:29, Jeff <[email protected]> wrote:
>
> > > I'm trying to set up validation in a join table to check that a pair
> > > of fields is unique in the table.  Currently the join model is being
> > > created automagically between the HABTM tables.  Can I create a join
> > > model and define the validation there?  Would it make more sense to
> > > break the HABTM up into two hasMany relationships?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to