From e739eb036df23db4a03681190bf07ba0b8f1302c Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 21 Apr 2015 15:23:20 +0200 Subject: Move participants method to shared Participable concern. --- app/models/commit.rb | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'app/models/commit.rb') diff --git a/app/models/commit.rb b/app/models/commit.rb index 1985793c600..be5a118bfec 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -3,8 +3,10 @@ class Commit include StaticModel extend ActiveModel::Naming include Mentionable + include Participable attr_mentionable :safe_message + participant :author, :committer, :notes, :mentioned_users attr_accessor :project @@ -137,21 +139,6 @@ class Commit User.find_for_commit(committer_email, committer_name) end - def participants(current_user = nil) - users = [] - users << author - users << committer - - users.push *self.mentioned_users(current_user) - - notes.each do |note| - users << note.author - users.push *note.mentioned_users(current_user) - end - - users.uniq - end - def notes project.notes.for_commit_id(self.id) end -- cgit v1.2.1