mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-07 20:40:26 +08:00
fix image removing from tinymce
This commit is contained in:
parent
dec1e53b53
commit
e233fbe1d8
1 changed files with 7 additions and 1 deletions
|
@ -54,6 +54,12 @@ module TinyMceHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy_removed_tiny_mce_assets(ids, ref)
|
def destroy_removed_tiny_mce_assets(ids, ref)
|
||||||
|
# need to check if the array is empty because if we pass the empty array
|
||||||
|
# in the SQL query it will not work properly
|
||||||
|
if ids.empty?
|
||||||
|
ref.tiny_mce_assets.destroy_all
|
||||||
|
else
|
||||||
ref.tiny_mce_assets.where.not('id IN (?)', ids).destroy_all
|
ref.tiny_mce_assets.where.not('id IN (?)', ids).destroy_all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue