summaryrefslogtreecommitdiff
path: root/app/models/discussion_note.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-03-09 19:29:11 -0600
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-05 17:44:14 +0100
commit08bbb9fce66cb46d3262e6cd4c4379b59f065be0 (patch)
tree159eeb7ca43419f29926d6e77637db18bddd20a9 /app/models/discussion_note.rb
parent8bdfee8ba5fb0a8f48501e63274c8f9ce5708007 (diff)
downloadgitlab-ce-08bbb9fce66cb46d3262e6cd4c4379b59f065be0.tar.gz
Add option to start a new discussion on an MR
Diffstat (limited to 'app/models/discussion_note.rb')
-rw-r--r--app/models/discussion_note.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/discussion_note.rb b/app/models/discussion_note.rb
new file mode 100644
index 00000000000..fc168ae74a9
--- /dev/null
+++ b/app/models/discussion_note.rb
@@ -0,0 +1,9 @@
+class DiscussionNote < Note
+ NOTEABLE_TYPES = %w(MergeRequest).freeze
+
+ validates :noteable_type, inclusion: { in: NOTEABLE_TYPES }
+
+ def discussion_class(*)
+ SimpleDiscussion
+ end
+end