discourse/app/jobs/scheduled/create_missing_avatars.rb
Sam 504cfcff96 Fix specs for avatars
Implement avatar picker
Correct avatar related jobs
2014-05-27 10:08:03 +10:00

16 lines
331 B
Ruby

module Jobs
class CreateMissingAvatars < Jobs::Scheduled
every 1.hour
def execute(args)
User.where(uploaded_avatar_id: nil).find_each do |u|
u.refresh_avatar
u.save
end
UserAvatar.where(system_upload_id: nil).find_each do |a|
a.update_system_avatar!
end
end
end
end