Hey, you can create a custom validation function which will check for unique data in both fields.
Faifas On Mon, Sep 14, 2009 at 13:10, Shaun <[email protected]> wrote: > > I have a table called comment_ratings where users can rate comments up > or down. It looks like this: > > TABLE: comment_ratings > id => INT > rating_value => TINYINT > comment_id => INT > user_id => INT > created => DATETIME > modified => DATETIME > > Users should only be allowed one vote on each comment, so I have > created a unique key on two fields, comment_id and user_id. The name > of the key is unique_rating_per_user. This works fine in my database, > but how can I add the unique validation to the CommentRating model? > As far as I know, isUnique only handles one field. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
