Fix notes for commits inside MR being squashed in one discussion

This commit is contained in:
Dmitriy Zaporozhets 2013-04-04 09:58:12 +03:00
parent 64fb2c595a
commit 568ce1edd7
2 changed files with 2 additions and 3 deletions

View File

@ -71,7 +71,6 @@ class NotesController < ProjectResourceController
# Helps to distinguish e.g. commit notes in mr notes list
def note_for_main_target?(note)
note.for_wall? ||
(@target_type.camelize == note.noteable_type && !note.for_diff_line?)
(@target_type.camelize == note.noteable_type && !note.for_diff_line?)
end
end

View File

@ -88,7 +88,7 @@ class Note < ActiveRecord::Base
end
def discussion_id
@discussion_id ||= [:discussion, noteable_type.try(:underscore), noteable_id, line_code].join("-").to_sym
@discussion_id ||= [:discussion, noteable_type.try(:underscore), noteable_id || commit_id, line_code].join("-").to_sym
end
# Returns true if this is a downvote note,