diff --git a/app/models/profile.rb b/app/models/profile.rb index 112e9d988..3098c1f52 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -27,6 +27,11 @@ class Profile def person_id self._parent_document.id end + + def person_id= id + person = Person.first(:id => id) + person.profile = self + end def to_diaspora_xml ""+ self.to_xml.to_s + "" diff --git a/lib/diaspora/diaspora_parser.rb b/lib/diaspora/diaspora_parser.rb index c40106e36..f617c5809 100644 --- a/lib/diaspora/diaspora_parser.rb +++ b/lib/diaspora/diaspora_parser.rb @@ -50,10 +50,7 @@ module Diaspora User.owner.receive_friend_request(p) #This line checks if the sender was in the database, among other things? elsif p.is_a? Profile - person = Person.first(:id => p.person_id) - person.profile = p - puts person.profile.save - puts person.save + puts p.save elsif p.respond_to?(:person) && !(p.person.nil?) && !(p.person.is_a? User) #WTF Rails.logger.info("Saving object with success: #{p.save}") end