I have User HABTM Professions. In user edit, there is a list of checkboxes of professions. It was working when I defined the HABTM relationship in user model. But as that relationship was interrupting other functions I removed it and put this in user controller
$this->User->bindModel(
array(
'hasAndBelongsToMany' =>
array(
'Profession' =>
array(
'className' => 'Profession',
'joinTable' => 'professions_users',
'foreignKey' => 'user_id',
'associationForeignKey' => 'profession_id',
'unique' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)
)
)
);
The return value of that binding function is also true.
Now when I call $this->User->saveAll($this->data), rows are not created in professions_users table anymore.
Any idea?