Okay so i have a bit of a problem, i have videos and vides have as has_many relation for comments, my problem is that my relation limit is ignored, i posted this question, got a hint from Harro, did the way he said (atleast i hope i did) and the limit is still ignored.
Code: $results = Model_Video::find('all', array( 'where' => array( array('id', $id), array('video_slug', $slug), ), 'related' => array( 'videocomments' => array( 'order_by' => array( array('id', 'desc'), ), array('limit' => 5), ), ) )); So the problem is it showing all the comments, and i have no clue why, so could please someone give me a hint for this? i would really be grateful
rows_limit will only work on the query as a whole, not on a relation, as it will limit the entire query. if you want to use that, it has to be defined at the top level of the array, so the same level as 'where' and 'related'.