Merge pull request #4878 from artoscinote/ma_SCI_7803

Fix pasting same image multiple times [SCI-7803]
This commit is contained in:
artoscinote 2023-01-24 12:35:18 +01:00 committed by GitHub
commit 3fdbed382e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,7 +28,7 @@ class TinyMceAsset < ApplicationRecord
.scan(/data-mce-token="([^"]+)"/)
.flatten
images = JSON.parse(images) | text_images
images = JSON.parse(images) + text_images
current_images = object.tiny_mce_assets.pluck(:id)
images_to_delete = current_images.reject do |x|