From 76079bb47d6c8618531bc702e9d6f649097ce69a Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Fri, 14 Dec 2018 13:36:24 +0100 Subject: [PATCH] one line the loop, thanks for the hint @MrSerth --- app/models/request_for_comment.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/models/request_for_comment.rb b/app/models/request_for_comment.rb index 2461ca7b..b4fa819b 100644 --- a/app/models/request_for_comment.rb +++ b/app/models/request_for_comment.rb @@ -46,11 +46,7 @@ class RequestForComment < ApplicationRecord end def commenters - commenters = [] - comments.each {|comment| - commenters.append comment.user - } - commenters.uniq + comments.map(&:user).uniq end def self.with_last_activity