diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-03-05 20:19:01 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-03-05 20:19:01 -0500 |
commit | dcbf7d13c41a3761b80c1297ad6f7859999797f9 (patch) | |
tree | 16f4453bbd55848e374f3bff791f126e089803a8 | |
parent | 9bbf873e467652b76654cef2fd7ad2ae2110f2fd (diff) | |
download | gitlab-ce-dcbf7d13c41a3761b80c1297ad6f7859999797f9.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.rb | 4 |
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? |