mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-14 22:01:28 +00:00
Return distinct topics
This commit is contained in:
parent
8200ff38a0
commit
6e4ebd4d1f
1 changed files with 1 additions and 1 deletions
|
@ -43,7 +43,7 @@ class Topic < ActiveRecord::Base
|
||||||
|
|
||||||
def self.recent_topics
|
def self.recent_topics
|
||||||
find_by_sql %q{
|
find_by_sql %q{
|
||||||
SELECT topics.*
|
SELECT DISTINCT topics.*
|
||||||
FROM (SELECT max(id) as max_id, topic_id
|
FROM (SELECT max(id) as max_id, topic_id
|
||||||
FROM posts
|
FROM posts
|
||||||
GROUP BY topic_id
|
GROUP BY topic_id
|
||||||
|
|
Loading…
Reference in a new issue