Database Through Relations

Good evening,

In this page ( it’s described how to get all comments for all users of a particular group using ‘through’.

How can I do exactly the opposite? That is, get the group of the user who made a particular comment.

So far, I’m not even able to reach ‘role’ table:

'user' => array(self::BELONGS_TO, 'User', 'user_id'),

'roles'=>array(self::HAS_MANY, 'Role', array('id'=>'user_id'), 'through' => 'user') // shouldn't it join to Role.user_id ?

It’s raising the following error: 'Column not found: 1054 Unknown column ‘user.user_id’ in ‘where clause’. And it seems related to the first line, not the second…

Any ideas?