Rails 3 model associations. Limit the number of data selected
I have a model user, a feed, and a comment. user has many feeds and comments, feeds belong to user and have many comments and finally comments belong to user and feed.
No when i show feeds for a certain user, it selects all the comments made till date for every feed. I want it to select only those comments that were made in the last 1 min, 开发者_StackOverflow社区and if none were, i want to show the 2 most recent ones... how can i do that???
精彩评论