As I recall you used to not be able to eager load them, but if you read the following from the Definitive guide it now says you can eager load stat queries:
You guys are not the only ones. Working with relations in Yii is challenging to say the least. While the documentation is good, it doesn’t provide examples for common scenarios and use cases.
Let’s say you have three models: Post, Author, and Comment. Each Post has one Author. Each Comment belongs to a Post.
To fetch all Posts with Authors and Comments using eager loading:
$criteria = new CDbCriteria();
$criteria->together = true; // <-- If 'on' used in join, 'together' should be removed.
$criteria->with = array('authors', 'comments');
$model = Post::model()->findAll($criteria);
I just rethought about this problem. and I have to point out, if with(‘relation’)->findAll() failed to perform eager loading, then the documentation(‘Relational Active Record’) is misleading. maybe somebody from dev team can clarify this issue? thanks a lot.