Displaying 1 result from an estimated 1 matches for "topics_id".
Did you mean:
topic_id
2006 Nov 22
0
Returning objects (not ids) in grouped count
...:group => "topics.id",
:order => "count_all DESC"
Returns an array of arrays, each array containing a topic id and count,
like:
[[302, 12], [110, 7]]
That''s because the SQL generated by my command above looks like:
SELECT count(*) AS count_all, topics.id AS topics_id FROM topics INNER
JOIN postings ON topics.id = postings.topic_id WHERE (user_id = 1) GROUP
BY topics.id ORDER BY count_all DESC
This isn''t that useful, since I''ll need to go back and requery by topic
id to get the topic object. What I want is a result like this:
[[#<Topic:...