summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorDrew Blessing <drew.blessing@buckle.com>2013-12-26 10:50:29 -0600
committerDrew Blessing <drew.blessing@buckle.com>2014-01-06 15:38:13 -0600
commit09cbe95b20f87ac95dd84a3a033e3f0a1b9aa5a5 (patch)
treef172a3788a193bcf290df2f49f3c86f4141d4246 /app/models/note.rb
parent6579de0727b37535ecba3a8f6188f51a714e3a3e (diff)
downloadgitlab-ce-09cbe95b20f87ac95dd84a3a033e3f0a1b9aa5a5.tar.gz
Add note for assignee changes
Change to username per @PixnBits suggestion
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 48b36bcafdf..67755f44148 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -82,6 +82,18 @@ class Note < ActiveRecord::Base
}, without_protection: true)
end
+ def create_assignee_change_note(noteable, project, author, assignee)
+ body = assignee.nil? ? '_Assignee removed_' : "_Reassigned to @#{assignee.username}_"
+
+ create({
+ noteable: noteable,
+ project: project,
+ author: author,
+ note: body,
+ system: true
+ }, without_protection: true)
+ end
+
def discussions_from_notes(notes)
discussion_ids = []
discussions = []