@@ -4,6 +4,10 class RemoveUsersMail < ActiveRecord::Migration | |||||
4 | end |
|
4 | end | |
5 |
|
5 | |||
6 | def self.down |
|
6 | def self.down | |
7 | raise IrreversibleMigration |
|
7 | add_column :users, :mail, :string, :limit => 60, :default => '', :null => false | |
|
8 | ||||
|
9 | EmailAddress.where(:is_default => true).each do |a| | |||
|
10 | User.where(:id => a.user_id).update_all(:mail => a.address) | |||
|
11 | end | |||
8 | end |
|
12 | end | |
9 | end |
|
13 | end |
General Comments 0
You need to be logged in to leave comments.
Login now