Rails nested has_many association, how to get, say, last 5 of all children?
- by Randuin
Let's say that
Post has_many :comments
and that
Comment has_many :ratings
How can I grab the last 5 comment ratings for each Post? I've been thinking of just looping through comment for each post but that wouldn't solve the Last 5 part.