Useful Rails Query
Ruby
Find users with more than 5 posts using ActiveRecord:
`User.joins(:posts).group(:id).having("COUNT(posts.id) > 5")`
Find users with more than 5 posts using ActiveRecord:
`User.joins(:posts).group(:id).having("COUNT(posts.id) > 5")`