Commit dac29e28 authored by PiTrem's avatar PiTrem
Browse files

container entity: fix img preview

parent 1ddd9a30
......@@ -42,7 +42,9 @@ module Entities
private
def preview_img(container_ids, attachments)
attachment = attachments.find { |a| a.thumb == true && container_ids.include?(a.id)}
attachment = attachments.find { |a|
a.thumb == true && a.attachable_type == 'Container' && container_ids.include?(a.attachable_id)
}
preview = attachment.read_thumbnail if attachment
preview && Base64.encode64(preview) || "not available"
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment