Fix migration
This commit is contained in:
parent
0efa8c83a2
commit
d57347648f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue