FIX: Don't update user_profile URLs unless upload is persisted.

This commit is contained in:
Guo Xiang Tan
2018-10-01 14:20:50 +08:00
parent 4b517d460d
commit de85bb0a39
2 changed files with 28 additions and 1 deletions

View File

@ -64,7 +64,7 @@ class UploadRecovery
puts "#{background}"
else
recover_user_profile_background(sha1, user_profile.user_id) do |upload|
user_profile.update!("#{column}" => upload.url)
user_profile.update!("#{column}" => upload.url) if upload.persisted?
end
end
end