Fix migration

This commit is contained in:
Pavel Chipiga 2011-10-17 13:29:07 +03:00
parent 0efa8c83a2
commit d57347648f
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ class AddExtraFieldsToUsers < ActiveRecord::Migration
add_column :users, :nickname, :string
add_column :users, :ssh_key, :text
add_index :users, :nickname, :unique => true
User.all.each {|u| u.update_attribute :nickname, u.email.split('@').first}
User.all.each {|u| User.where(:id => u.id).update_all(:nickname => u.email.split('@').first)}
end
def self.down