I have a Blog model that has defined var $hasMany=array("Comment");
How can i apply a filter on the Comments to select only the Blog items that match a certain Comment category?
If, in the Blog model, i do
$this->recursive=2;
$this->hasMany=array("Comment"); //in Comment i have $belongsTo("Blog")
return $this->find("all",array("conditions"=>array("Comment.comment_type_id"=>123)));
i get an error that says Unknown Comment.comment_type_id column because Cake does not make the join.
I think this is a rather common issue so i believe simple to solve but i can't find a good way