Fix #4969: Tag changes made by replacements wipe out edits done at the same time.

Lock the post during replacement to ensure we have the latest version of
the tags and to ensure nobody else can modify the post until after the
replacement is finished.
This commit is contained in:
evazion
2022-02-01 00:59:42 -06:00
parent 60a13fd2d5
commit 7435f2e516
3 changed files with 6 additions and 4 deletions

View File

@@ -12,8 +12,6 @@ class PostReplacement < ApplicationRecord
def initialize_fields
self.original_url = post.source
self.tags = "#{post.tag_string} #{tags}"
self.old_file_ext = post.file_ext
self.old_file_size = post.file_size
self.old_image_width = post.image_width