diff --git a/db/migrate/20111011182847_add_extra_fields_to_users.rb b/db/migrate/20111011182847_add_extra_fields_to_users.rb index 052ba39db..49fbbf1e5 100644 --- a/db/migrate/20111011182847_add_extra_fields_to_users.rb +++ b/db/migrate/20111011182847_add_extra_fields_to_users.rb @@ -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