Hi All, I'm having an issue with using HABTM with pagination...
My app has a users and roles table - users HABTM roles, roles have many users. In my users index controller I'm trying to limit the pagination results so that only users with certain roles are displayed. At the moment I have: $this->User->recursive = 1; $this->set('users', $this->paginate('User', array('Roles.name' => 'Administrator'))); This gives me this error: Warning (512): SQL Error: 1054: Unknown column 'Roles.name' in 'where clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 525] When I do pretty much the same this with a 'find all' it seems to work ok: $this->set('data', $this->User->Role->find('all', array ('conditions'=>array('Role.name'=>'Administrator')))); Where am I going wrong here? TIA --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---