Skip to content
Snippets Groups Projects
Commit 3d7f88c1 authored by Douwe Maan's avatar Douwe Maan
Browse files

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

Former-commit-id: de872f26
parents 4ae62d33 d56ce1b8
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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|
Loading
Loading
@@ -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?
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment