0
ň後我有User
和Post
模型has_many<=>belongs_to
Rails的查詢超過每日期
我需要找到用戶其中超過每天n個崗位
我這樣做只是這個查詢有可以讓我找到用戶比N更多的帖子
User.select('users.*, count(posts.id)').joins(:posts).group('posts.id').having('count(posts.id) > 1')
如何更新我的查詢?