fix the null person ID bug in profile

This commit is contained in:
maxwell 2011-01-27 13:44:26 -08:00
parent 3ebda174fb
commit 0913389698

View file

@ -138,13 +138,14 @@ class Person < ActiveRecord::Base
#hcard_profile = HCard.find profile.hcard.first[:href]
Rails.logger.info("event=webfinger_marshal valid=#{new_person.valid?} target=#{new_person.diaspora_handle}")
new_person.url = hcard[:url]
new_person.profile = Profile.create!(:first_name => hcard[:given_name],
new_person.profile = Profile.new(:first_name => hcard[:given_name],
:last_name => hcard[:family_name],
:image_url => hcard[:photo],
:image_url_medium => hcard[:photo_medium],
:image_url_small => hcard[:photo_small],
:searchable => hcard[:searchable])
new_person.save!
new_person.profile.save!
new_person
end