I have a model named permission.
Permission has many roles permission has many users permission has many denied users
Below is from the permissions model:
protected $_has_many = array(
'user' => array('through' => 'user_permission'),
'permissiondeny' => array('model' => 'user', 'through' => 'user_permissiondeny','foreign_key' => 'permissiondeny_id'),
'role' => array('through' => 'role_permission'),
);
The user and role relationships work as expected. I can select the deny permission, but when I try to add a new one I get the following php error:
PHP Fatal error: Uncaught Database_Exception [ 1110 ]: Column 'permissiondeny_id' specified twice [ INSERT INTO user_permissiondeny
(permissiondeny_id
, permissiondeny_id
) VALUES ('1', 1) ] ~ MODPATH/database/classes/kohana/database/mysql.php [ 194 ]
Any suggestions as to what I'm missing?