summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-21 15:23:20 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-24 12:30:36 +0200
commite739eb036df23db4a03681190bf07ba0b8f1302c (patch)
tree599e01be53f1818f2d7260734fc0dd4fab71dcff /app/models/commit.rb
parent0ff778c0f4a3b599d0f36a1deee5607d03e52b9a (diff)
downloadgitlab-ce-e739eb036df23db4a03681190bf07ba0b8f1302c.tar.gz
Move participants method to shared Participable concern.
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb17
1 files changed, 2 insertions, 15 deletions
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