-
Notifications
You must be signed in to change notification settings - Fork 8
hasOne not automatically bound when calling $Model::find('list'); #4
Comments
I did some poking around in /cake/libs/model/model.php and in the _findList() function, I found this: |
On a related note, I'm running into a similar problem when trying to save something to the Group table, where first the ability to write to the table is verified. The SQL is appearing as: In \models\behaviors\permissionable.php I tried adding I also tried modifying $queryData['recursive'] directly in the beforeFind() function, but that caused my browser to be unable to resolve the page. |
Two alternatives are:
|
Of course in the second case you would have to use Set::extract() or something similar on the results to leave only the 'user_id' => 'user_name'. |
Any real solution to this? The same issue crops up when attempting to use the tree behavior. |
I'm trying to do this:
and my SQL is coming out like this:
In permisssionable/models/behaviors/permissionable.php, when I debugged the $Model before and after this line of the beforeFind() function:
the $Model did not and then did have a 'hasOne' binding to GroupPermission however for some reason it isn't being applied to the ->find('list') query.
I tried to do a $this->Group->find('all'); and that did work as expected.
I'm calling $this->Group from my users_controller where I have:
var $uses = array('User', 'Group');
I have User HABTM Group and Group HABTM User defined in the appropriate model files.
The text was updated successfully, but these errors were encountered: