AR alias problem

I've AR named Category. Here is my relations

        'post'=>array(self::HAS_MANY, 'Publication', 'id'),

        'blog'=>array(self::HAS_ONE, 'Blog', 'blog_id'),


and scopes

    public function defaultScope() {

        return array(




    public function scopes() {

        return array(






I need to get category with subcategories, so here is my code


The problem is that the main category and the child has status field. How can i set defaultScope to make it work with main record and with relation too. Something like alias, but not for relation.

in defaultScopt, declare 'alias'=>'table name', and then prefix 'status' with this alias.

Ok, and if i need this scope for both - category and child?