Commit 568ce1edd7df2eaf511878ccc3b202fcad7931a3
1 parent
64fb2c59
Exists in
master
and in
4 other branches
Fix notes for commits inside MR being squashed in one discussion
Showing
2 changed files
with
2 additions
and
3 deletions
Show diff stats
app/controllers/notes_controller.rb
| @@ -71,7 +71,6 @@ class NotesController < ProjectResourceController | @@ -71,7 +71,6 @@ class NotesController < ProjectResourceController | ||
| 71 | 71 | ||
| 72 | # Helps to distinguish e.g. commit notes in mr notes list | 72 | # Helps to distinguish e.g. commit notes in mr notes list |
| 73 | def note_for_main_target?(note) | 73 | def note_for_main_target?(note) |
| 74 | - note.for_wall? || | ||
| 75 | - (@target_type.camelize == note.noteable_type && !note.for_diff_line?) | 74 | + (@target_type.camelize == note.noteable_type && !note.for_diff_line?) |
| 76 | end | 75 | end |
| 77 | end | 76 | end |
app/models/note.rb
| @@ -88,7 +88,7 @@ class Note < ActiveRecord::Base | @@ -88,7 +88,7 @@ class Note < ActiveRecord::Base | ||
| 88 | end | 88 | end |
| 89 | 89 | ||
| 90 | def discussion_id | 90 | def discussion_id |
| 91 | - @discussion_id ||= [:discussion, noteable_type.try(:underscore), noteable_id, line_code].join("-").to_sym | 91 | + @discussion_id ||= [:discussion, noteable_type.try(:underscore), noteable_id || commit_id, line_code].join("-").to_sym |
| 92 | end | 92 | end |
| 93 | 93 | ||
| 94 | # Returns true if this is a downvote note, | 94 | # Returns true if this is a downvote note, |