开发者

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???

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜