better support for mixed content

This commit is contained in:
Régis Hanol
2015-06-01 17:49:58 +02:00
parent 67cc96f20d
commit 81a699e2b0
5 changed files with 23 additions and 25 deletions

View File

@ -13,7 +13,7 @@ class OptimizedImage < ActiveRecord::Base
# do we already have that thumbnail?
thumbnail = find_by(upload_id: upload.id, width: width, height: height)
# make sure the previous thumbnail has not failed
# make sure we have an url
if thumbnail && thumbnail.url.blank?
thumbnail.destroy
thumbnail = nil