From 0913389698a1d7c542885df31d43a2d98b49a7ef Mon Sep 17 00:00:00 2001 From: maxwell Date: Thu, 27 Jan 2011 13:44:26 -0800 Subject: [PATCH] fix the null person ID bug in profile --- app/models/person.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/person.rb b/app/models/person.rb index d7e67fe49..98c9fc627 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -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