search for: comment_total

Displaying 1 result from an estimated 1 matches for "comment_total".

2006 Apr 03
2
Order By Number of Comments
...This is what I have been trying in the controller, with no luck : def show_discussed @contents.find(:all, :order => "contents.comment.size DESC", :joins => "comments") end I have got some SQL that works : (I renamed posts to contents) select contents.*, count(*) as comment_total from contents, comments WHERE contents.id = comments.content_id group by contents.id; But this does not return the posts with no comments. I would really appreciate any help. Thank you in advance. Hamza -- Posted via http://www.ruby-forum.com/.