DG IZ trying asymetric searization and marshaling

This commit is contained in:
ilya 2010-07-29 19:12:20 -07:00
parent dea85f580f
commit 0aa268a62d
2 changed files with 6 additions and 4 deletions

View file

@ -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
"<post>"+ self.to_xml.to_s + "</post>"

View file

@ -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