Is it possible to write this query (or some other query that does essentially the same) using just ActiveRecord.find?
SELECT posts.title, COUNT(comments.id) FROM posts, comments WHERE posts.id = comments.post_id GROUP BY posts.id ORDER BY 2 DESC
Basically the model Post has many Comments and I want to get the posts with most comments. Also, if possible, I'd also like the query to select posts even if the comment count is 0, with no particular order.
Thanks in advance.