Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-03-10 04:29:11 +0300
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-05 19:44:14 +0300
commit08bbb9fce66cb46d3262e6cd4c4379b59f065be0 (patch)
tree159eeb7ca43419f29926d6e77637db18bddd20a9 /app/models/concerns/noteable.rb
parent8bdfee8ba5fb0a8f48501e63274c8f9ce5708007 (diff)
Add option to start a new discussion on an MR
Diffstat (limited to 'app/models/concerns/noteable.rb')
-rw-r--r--app/models/concerns/noteable.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb
new file mode 100644
index 00000000000..7900af6aaac
--- /dev/null
+++ b/app/models/concerns/noteable.rb
@@ -0,0 +1,17 @@
+module Noteable
+ def discussion_notes
+ notes
+ end
+
+ delegate :find_discussion, :find_original_discussion, to: :discussion_notes
+
+ def discussions
+ @discussions ||= discussion_notes
+ .inc_relations_for_view
+ .discussions(self)
+ end
+
+ def grouped_diff_discussions
+ notes.inc_relations_for_view.grouped_diff_discussions
+ end
+end