Fix migration for person to user migration
This commit is contained in:
parent
ef07990e94
commit
8596644afa
1 changed files with 2 additions and 1 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.find_by(id: p.user_id)
|
||||||
|
next unless user
|
||||||
if p.public_name.empty?
|
if p.public_name.empty?
|
||||||
user.name = p.email
|
user.name = p.email
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue