I wrote one a while back and posted it to this group. can't seem to find it now, but here's a link to it stored elsewhere:
http://markmail.org/message/nleqrkgtm2ji6sfe On Sep 14, 11:10 am, Shaun <sbef...@gmail.com> 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---