Re: Validating HABTM

2011-06-15 Thread Rob Maurer
Interesting. What would happen if you put the validation in the model for the join table? On Jun 14, 3:17 pm, Shaz shazam...@gmail.com wrote: I can - but in that arises another situation: I also have Location HABT Language - and I don't want any restrictions there. So a location can have more

Re: Validating HABTM

2011-06-15 Thread Shaz
I haven't actually made models for the Join table - I don't think you need to for a HABTM relationship On Jun 15, 1:41 pm, Rob Maurer robmau...@gmail.com wrote: Interesting. What would happen if you put the validation in the model for the join table? On Jun 14, 3:17 pm, Shaz

Re: Validating HABTM

2011-06-15 Thread nachopitt
You should check this: http://bakery.cakephp.org/articles/nachopitt/2010/07/01/habtm-validatable-behavior On 15 jun, 08:24, Shaz shazam...@gmail.com wrote: I haven't actually made models for the Join table - I don't think you need to for a HABTM relationship On Jun 15, 1:41 pm, Rob Maurer

Validating HABTM

2011-06-14 Thread Shaz
I have User HABTM Language, and i want to ensure during a User add / edit they choose a minimum of one language, upto a maximum of 3. In the user model, for $validate I've tried: 'Language' = array( 'multiple' = array( 'rule' =

Re: Validating HABTM

2011-06-14 Thread hunny
Write the Validation Rule in Language Model instead of User Model On Jun 14, 9:56 pm, Shaz shazam...@gmail.com wrote: I have User HABTM Language, and i want to ensure during a User add / edit they choose a minimum of one language, upto a maximum of 3. In the user model, for $validate I've

Re: Validating HABTM

2011-06-14 Thread Shaz
I can - but in that arises another situation: I also have Location HABT Language - and I don't want any restrictions there. So a location can have more than 3 or no languages associated with it. So if place the above $validate in language model, both users and locations will need to pass that