mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class RemoveHasCustomAvatarFromUserStats < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :user_stats, :has_custom_avatar
|
||||
end
|
||||
end
|
||||
12
db/migrate/20140522003151_add_user_avatars.rb
Normal file
12
db/migrate/20140522003151_add_user_avatars.rb
Normal 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
|
||||
Reference in New Issue
Block a user