From 8558c5041f6279338a8a0cfe0b0235107db04879 Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Thu, 13 Dec 2018 16:16:12 +0100 Subject: [PATCH] fix active record induced error on postgres by removing distinct. Inlining the code did not turn out well, as we have to cope with the polymorphic association of user here.. --- app/models/request_for_comment.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/request_for_comment.rb b/app/models/request_for_comment.rb index fe15409b..2461ca7b 100644 --- a/app/models/request_for_comment.rb +++ b/app/models/request_for_comment.rb @@ -47,10 +47,10 @@ class RequestForComment < ApplicationRecord def commenters commenters = [] - comments.distinct.to_a.each {|comment| + comments.each {|comment| commenters.append comment.user } - commenters.uniq {|user| user.id} + commenters.uniq end def self.with_last_activity