Work in progress, keeping avatars locally

This introduces a new model to store the avatars and 3 uploads per user (gravatar, system and custom)

user can then pick which they want.
This commit is contained in:
Sam
2014-05-22 17:37:02 +10:00
committed by Sam Saffron
parent 4ccf07be8c
commit 6c1c8be794
42 changed files with 626 additions and 319 deletions

View File

@@ -23,3 +23,8 @@ User.seed do |u|
u.email_private_messages = false
u.trust_level = TrustLevel.levels[:elder]
end
# download avatars for existing users
if UserAvatar.count < User.count
Jobs.enqueue(:create_missing_avatars)
end

View File

@@ -0,0 +1,5 @@
class RemoveHasCustomAvatarFromUserStats < ActiveRecord::Migration
def change
remove_column :user_stats, :has_custom_avatar
end
end

View File

@@ -0,0 +1,12 @@
class AddUserAvatars < ActiveRecord::Migration
def change
create_table :user_avatars do |t|
t.integer :user_id, null: false
t.integer :system_upload_id
t.integer :custom_upload_id
t.integer :gravatar_upload_id
t.datetime :last_gravatar_download_attempt
t.timestamps
end
end
end