summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 006fa62c8f9..f54696c378c 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -134,6 +134,25 @@ class Commit
User.find_for_commit(committer_email, committer_name)
end
+ def participants(project, current_user = nil)
+ users = []
+ users << author
+ users << committer
+ mentions = []
+ mentions << self.mentioned_users(current_user, project)
+
+ notes(project).each do |note|
+ users << note.author
+ mentions << note.mentioned_users(current_user, project)
+ end
+
+ users.concat(mentions.reduce([], :|)).uniq
+ end
+
+ def notes(project)
+ project.notes.for_commit_id(self.id)
+ end
+
def method_missing(m, *args, &block)
@raw.send(m, *args, &block)
end