diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-21 18:10:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-21 18:10:03 +0300 |
commit | d5098d9fe3a5f05d9b90996851ab753f8b40cf65 (patch) | |
tree | 6f909667e89a3ad70e10c39b48fc417459b759fd /app/services/discussions | |
parent | 4ea7a80898d3266d386ca928d7c253d4bf588e1c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/discussions')
-rw-r--r-- | app/services/discussions/capture_diff_note_position_service.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/discussions/capture_diff_note_position_service.rb b/app/services/discussions/capture_diff_note_position_service.rb index 4e8fd90a2e7..87aa27e455f 100644 --- a/app/services/discussions/capture_diff_note_position_service.rb +++ b/app/services/discussions/capture_diff_note_position_service.rb @@ -19,13 +19,16 @@ module Discussions position = result[:position] return unless position + line_code = position.line_code(project.repository) + return unless line_code + # Currently position data is copied across all notes of a discussion # It makes sense to store a position only for the first note instead # Within the newly introduced table we can start doing just that DiffNotePosition.create_or_update_for(discussion.notes.first, diff_type: :head, position: position, - line_code: position.line_code(project.repository)) + line_code: line_code) end private |