summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-03-05 20:19:01 -0500
committerRobert Speicher <rspeicher@gmail.com>2016-03-05 20:19:01 -0500
commitdcbf7d13c41a3761b80c1297ad6f7859999797f9 (patch)
tree16f4453bbd55848e374f3bff791f126e089803a8
parent9bbf873e467652b76654cef2fd7ad2ae2110f2fd (diff)
downloadgitlab-ce-rs-note-reuse-for-methods.tar.gz
Make better use of the `Note#for_*?` methodsrs-note-reuse-for-methods
We've got all these polymorphic type-checking methods, might as well use 'em everywhere it makes sense.
-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 1a7b2ba6d42..a473b5e7af3 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|
@@ -383,7 +383,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?