summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-03-07 08:32:49 +0000
committerDouwe Maan <douwe@gitlab.com>2016-03-07 08:32:49 +0000
commitde872f26687296fbd1cedfb73577ba55ea42c74e (patch)
treed5f99e79e0194ff6a867c079913f9ea9d1393a96 /app/models
parent20ed08ed8f4edee3845801e71c7b4c3f1d0132a2 (diff)
parentdcbf7d13c41a3761b80c1297ad6f7859999797f9 (diff)
downloadgitlab-ce-de872f26687296fbd1cedfb73577ba55ea42c74e.tar.gz
Merge branch 'rs-note-reuse-for-methods' into 'master'
Make better use of the `Note#for_*?` methods We've got all these polymorphic type-checking methods, might as well use 'em everywhere it makes sense. See merge request !3106
Diffstat (limited to 'app/models')
-rw-r--r--app/models/note.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index da07340f4a1..7662f7b5c17 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -87,7 +87,7 @@ class Note < ActiveRecord::Base
next if discussion_ids.include?(note.discussion_id)
# don't group notes for the main target
- if !note.for_diff_line? && note.noteable_type == "MergeRequest"
+ if !note.for_diff_line? && note.for_merge_request?
discussions << [note]
else
discussions << notes.select do |other_note|
@@ -375,7 +375,7 @@ class Note < ActiveRecord::Base
private
def awards_supported?
- (noteable.kind_of?(Issue) || noteable.is_a?(MergeRequest)) && !for_diff_line?
+ (for_issue? || for_merge_request?) && !for_diff_line?
end
def contains_emoji_only?