summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 0fa1a7ab615..deda494f475 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -117,6 +117,24 @@ class Note < ActiveRecord::Base
})
end
+ def create_new_commits_note(noteable, project, author, commits)
+ body = "Pushed new commits:\n\n"
+
+ commits.each do |commit|
+ message = "* #{commit.short_id} - #{commit.title}"
+ body << message
+ body << "\n"
+ end
+
+ create(
+ noteable: noteable,
+ project: project,
+ author: author,
+ note: body,
+ system: true
+ )
+ end
+
def discussions_from_notes(notes)
discussion_ids = []
discussions = []