Excuse me my english... I have two models: User and Note In user.php:
var $hasMany=array('Note'=>array('className'=>'Note',
'foreignKey'=>'user_id',
'dependent'=>'true',
'exclusive'=>'true'
)
);
In users_controller.php:
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for User', true));
$this->redirect(array('action'=>'index'));
}
if ($this->User->delete($id,true)) {
$this->Session->setFlash(__('User deleted', true));
$this->redirect(array('action'=>'index'));
}
}
But when I delete an user, the notes associated with the user are not eliminated!!!
What is wrong????