Commit 568ce1edd7df2eaf511878ccc3b202fcad7931a3

Authored by Dmitriy Zaporozhets
1 parent 64fb2c59

Fix notes for commits inside MR being squashed in one discussion

app/controllers/notes_controller.rb
... ... @@ -71,7 +71,6 @@ class NotesController < ProjectResourceController
71 71  
72 72 # Helps to distinguish e.g. commit notes in mr notes list
73 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 75 end
77 76 end
... ...
app/models/note.rb
... ... @@ -88,7 +88,7 @@ class Note < ActiveRecord::Base
88 88 end
89 89  
90 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 92 end
93 93  
94 94 # Returns true if this is a downvote note,
... ...