I actually want to check isUnique if they edit their username or email address. I want it to check their changed username or email against the database to make sure it already doesn't exist. Sorry for the confusion. Thanks again!
On Sep 10, 11:44 am, cricket <[email protected]> wrote: > On Fri, Sep 10, 2010 at 2:32 PM, Lance <[email protected]> wrote: > > I have a User model and I want to allow logged in users to edit their > > username or email address if they would like. I just want the > > username or email address that they've changed to check against the > > database to make sure it's unique. I'm using a beforeValidate method > > on the sign up process to check uniqueness and that works great but > > when they're are logged in and go to edit their account they're are > > able to change those fields without it checking isUnique in database. > > If I add isUnique in $validate array it always isUnique and will throw > > an error. Any help would be greatly appreciated! > > Add 'on' => 'create' to the validation options. The rule will be > ignored for existing records. 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
