CGridView and belongs_to relation

I am trying to get the cat_name depending to a article but I can ot manage it, what is wrong?


       

public function relations()

	{

		// NOTE: you may need to adjust the relation name and the related

		// class name for the relations automatically generated below.

		  return array('cats'=>array(self::BELONGS_TO, 'cats', 'cat_id', ));

	}

........

 $dataProvider=new CActiveDataProvider('arts', array(

                        'pagination'=>array(

                                'pageSize'=>self::PAGE_SIZE,                       

                        ),

        ),array('with'=>array('cats'),));

........

$this->widget('zii.widgets.grid.CGridView', array(

	'dataProvider'=>$dataProvider,

	'columns'=>array(

		

		array('name'=>'cat_id',value=>$data->cats->cat_name),

....



I found this


......

'columns'=>array(

		

		'cat.cat_name',

......

in the first post you have plural "cats->cat_name"


array('name'=>'cat_id',value=>$data->cats->cat_name),

in the second is "cat.cat_name"


 'cat.cat_name',

so if cat.cat_name works then in the first case changing from cats to cat would work.

eg.




array('name'=>'cat_id',value=>$data->cat->cat_name)