From 630e879066156e8593a8b42b531ef727227c60bf Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 17 Apr 2015 11:03:33 +0200 Subject: Clean up code somewhat. --- app/models/snippet.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'app/models/snippet.rb') diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 13703f4115f..c11c28805eb 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -90,15 +90,13 @@ class Snippet < ActiveRecord::Base def participants(current_user = self.author) users = [] users << author - - mentions = [] notes.each do |note| users << note.author - mentions << note.mentioned_users(current_user) + users.push *note.mentioned_users(current_user) end - users.concat(mentions.reduce([], :|)).uniq + users.uniq end class << self -- cgit v1.2.1