Fix specs for avatars

Implement avatar picker
Correct avatar related jobs
This commit is contained in:
Sam
2014-05-26 19:46:43 +10:00
committed by Sam Saffron
parent a864f8aefd
commit 504cfcff96
27 changed files with 228 additions and 158 deletions

View File

@@ -1,5 +1,5 @@
class AddUserAvatars < ActiveRecord::Migration
def change
def up
create_table :user_avatars do |t|
t.integer :user_id, null: false
t.integer :system_upload_id
@@ -8,5 +8,17 @@ class AddUserAvatars < ActiveRecord::Migration
t.datetime :last_gravatar_download_attempt
t.timestamps
end
add_index :user_avatars, [:user_id]
execute <<SQL
INSERT INTO user_avatars(user_id, custom_upload_id)
SELECT id, uploaded_avatar_id
FROM users
SQL
end
def down
drop_table :user_avatars
end
end

View File

@@ -0,0 +1,5 @@
class RemoveUploadedAvatarTemplateFromUsers < ActiveRecord::Migration
def change
remove_column :users, :uploaded_avatar_template
end
end