Merge 89537a8b93 into c34991db44
This commit is contained in:
commit
d69ce3cecd
1 changed files with 15 additions and 13 deletions
|
|
@ -9,7 +9,8 @@ class MigrateDataPersonToUser < ActiveRecord::Migration
|
||||||
|
|
||||||
def change
|
def change
|
||||||
TempPerson.all.each do |p|
|
TempPerson.all.each do |p|
|
||||||
user = TempUser.find(p.user_id)
|
user = TempUser.where('id = ?', p.user_id).first
|
||||||
|
unless user.nil?
|
||||||
if p.public_name.empty?
|
if p.public_name.empty?
|
||||||
user.name = p.email
|
user.name = p.email
|
||||||
else
|
else
|
||||||
|
|
@ -25,4 +26,5 @@ class MigrateDataPersonToUser < ActiveRecord::Migration
|
||||||
user.save!
|
user.save!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue