discourse/lib/tasks/avatars.rake
Sam 2791852bd8 FEATURE: ability to regenerate system avatars as needed
BUGFIX: made system letter avatar more thinner for less block look
2014-05-28 12:30:57 +10:00

25 lines
541 B
Ruby

desc "Rebuild all system avatars"
task "avatars:rebuild_system" => :environment do
i = 0
puts "Regenerating system avatars"
puts
UserAvatar.find_each do |a|
a.update_system_avatar!
putc "." if (i+=1)%10 == 0
end
puts
end
desc "Refresh all avatars (download missing gravatars, refresh system)"
task "avatars:refresh" => :environment do
i = 0
puts "Refreshing avatars"
puts
User.find_each do |user|
user.refresh_avatar
user.user_avatar.update_system_avatar!
putc "." if (i+=1)%10 == 0
end
puts
end