diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-02-06 14:11:33 +0800 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-02-13 15:15:51 +0800 |
commit | a7b1a4ef1ef0b466423b89472c362341f3749cdc (patch) | |
tree | 15d6073bcb2d29c0cebbcce22daab919cfb1e854 /app/models/individual_note_discussion.rb | |
parent | 032e800b93dfe36604d896f2128ea05ad1330ece (diff) | |
download | gitlab-ce-a7b1a4ef1ef0b466423b89472c362341f3749cdc.tar.gz |
Fix polling for transformed individual notes30299-fix-polling-for-transformed-notes
Sets `updated_at` so that the transformed note is returned together with
the new reply
Diffstat (limited to 'app/models/individual_note_discussion.rb')
-rw-r--r-- | app/models/individual_note_discussion.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/individual_note_discussion.rb b/app/models/individual_note_discussion.rb index aab0ff93468..b4a661ae5b4 100644 --- a/app/models/individual_note_discussion.rb +++ b/app/models/individual_note_discussion.rb @@ -17,8 +17,12 @@ class IndividualNoteDiscussion < Discussion noteable.supports_replying_to_individual_notes? && Feature.enabled?(:reply_to_individual_notes) end - def convert_to_discussion! - first_note.becomes!(Discussion.note_class).to_discussion + def convert_to_discussion!(save: false) + first_note.becomes!(Discussion.note_class).to_discussion.tap do + # Save needs to be called on first_note instead of the transformed note + # because of https://gitlab.com/gitlab-org/gitlab-ce/issues/57324 + first_note.save if save + end end def reply_attributes |