fix User#recent_threads for postgresql

This commit is contained in:
Serge Paquet 2014-01-16 21:33:00 -05:00
parent dd860f06e3
commit 577ce2307b

View file

@ -183,7 +183,8 @@ class User < ActiveRecord::Base
end
def recent_threads(amount)
self.comments.order('created_at desc').limit(amount).uniq.pluck(:thread_id)
self.comments.group(:thread_id).order('MAX(created_at) DESC').limit(
amount).pluck(:thread_id)
end
def stories_submitted_count