Merge pull request #106 from srgpqt/recent_threads
fix User#recent_threads for postgresql
This commit is contained in:
commit
27caa0a7a6
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue