Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-02-06 09:11:33 +0300
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-02-13 10:15:51 +0300
commita7b1a4ef1ef0b466423b89472c362341f3749cdc (patch)
tree15d6073bcb2d29c0cebbcce22daab919cfb1e854 /app/models/individual_note_discussion.rb
parent032e800b93dfe36604d896f2128ea05ad1330ece (diff)
Fix polling for transformed individual 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.rb8
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