FIX: OptimizedImage model doesn't have 'created_at' date column

This commit is contained in:
Vinoth Kannan 2019-02-14 03:46:00 +05:30
parent 426bd810f1
commit b8d2549922
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class S3Inventory
end
end
uploads = model.where("created_at < ?", last_modified)
uploads = (model == Upload) ? model.where("created_at < ?", last_modified) : model
missing_uploads = uploads.joins("LEFT JOIN #{table_name} ON #{table_name}.etag = #{model.table_name}.etag").where("#{table_name}.etag is NULL")
if (missing_count = missing_uploads.count) > 0