Merge pull request #247 from openHPI/fix_commentors_query

fix active record induced error on postgres by removing distinct.
This commit is contained in:
MrSerth
2018-12-14 18:13:06 +01:00
committed by GitHub

View File

@ -46,11 +46,7 @@ class RequestForComment < ApplicationRecord
end end
def commenters def commenters
commenters = [] comments.map(&:user).uniq
comments.distinct.to_a.each {|comment|
commenters.append comment.user
}
commenters.uniq {|user| user.id}
end end
def self.with_last_activity def self.with_last_activity