Fix the build.

This commit is contained in:
Guo Xiang Tan
2019-03-13 17:39:07 +08:00
parent b0c8fdd7da
commit 243fb8d9ad
4 changed files with 5 additions and 4 deletions

View File

@ -54,7 +54,7 @@ class S3Inventory
WHERE #{model.table_name}.etag IS NULL
AND url ILIKE '%' || #{table_name}.key")
uploads = (model == Upload) ? model.where("created_at < ?", inventory_date) : model
uploads = (model == Upload) ? model.by_users.where("created_at < ?", inventory_date) : 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