Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthoriJyrki
    • CommentTimeAug 12th 2007
     

    Hello!

    How to perform validations only on certain actions. I've got an action 'login' that needs to update 'user' record but validations stop it. Using the functions validatesOnCreate/validatesOnUpdate is not a possibility because some of the validations need to be run even in updates...

    -jyrki

    •  
      CommentAuthorbermi
    • CommentTimeAug 14th 2007
     

    In case you need to avoid validation when saving you just need to pass false to the User::save function like:

    $this->User->save(false);
    

    That will bypass validations when required.

    • CommentAuthoriJyrki
    • CommentTimeAug 15th 2007
     

    Hey and thanks, Bermi!

    -jyrki

    • CommentAuthoriJyrki
    • CommentTimeAug 18th 2007 edited
     

    Ok. Couple of model related questions.

    1. How to run e.g. password validation on reset_password-action but not on any other updates?
    2. How to bybass beforeSave on certain actions?

    -jyrki

Add your comments
    Username Password
  • Format comments as