From ce5867cce2b3af3b88a5445bdb6cb8c40bda59ce Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 17 May 2016 09:40:17 +1000 Subject: [PATCH] workaround issue where orphan user_avatar record exists --- app/jobs/scheduled/create_missing_avatars.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/jobs/scheduled/create_missing_avatars.rb b/app/jobs/scheduled/create_missing_avatars.rb index 8526b411553..2d4befe245f 100644 --- a/app/jobs/scheduled/create_missing_avatars.rb +++ b/app/jobs/scheduled/create_missing_avatars.rb @@ -5,6 +5,7 @@ module Jobs def execute(args) # backfill in batches of 5000 an hour UserAvatar.includes(:user) + .joins(:user) .where(last_gravatar_download_attempt: nil) .order("users.last_posted_at DESC") .limit(5000)