hi all
i tried to display name instead of id in my gridview and listview by using relationships in model.
i tried the below code and it worked fine.
return array('block' => array(self::BELONGS_TO, 'Block', 'rev_block_name')
and in my gridview
array( // display 'create_time' using an expression
'name'=>'rev_block_name',
'value'=>'$data->block->block_name',
),
this worked fine for me.
now if i need block_name in another model class i am getting an error "unknown column".i clearly defined my relationship but i am not able to figure out what is wrong with it.
one question: can we use name that is to be displayed in multiple relations.