Fix deleted file case in CKEditor

We were getting an error when browsing the server if one file had been
deleted.
This commit is contained in:
Javi Martín
2021-07-28 00:57:12 +02:00
parent 8c82ff290b
commit ca7f2bc9d5

View File

@@ -5,10 +5,10 @@ class Ckeditor::Picture < Ckeditor::Asset
validates :storage_data, file_content_type: { allow: /^image\/.*/ }, file_size: { less_than: 2.megabytes } validates :storage_data, file_content_type: { allow: /^image\/.*/ }, file_size: { less_than: 2.megabytes }
def url_content def url_content
rails_representation_url(storage_data.variant(resize: "800>").processed, only_path: true) rails_representation_url(storage_data.variant(resize: "800>"), only_path: true)
end end
def url_thumb def url_thumb
rails_representation_url(storage_data.variant(resize: "118x100").processed, only_path: true) rails_representation_url(storage_data.variant(resize: "118x100"), only_path: true)
end end
end end