Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthoriJyrki
     

    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
     

    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
     

    Hey and thanks, Bermi!

    -jyrki

    • CommentAuthoriJyrki
     

    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