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

@ -28,6 +28,11 @@ class Profile
self._parent_document.id self._parent_document.id
end end
def person_id= id
person = Person.first(:id => id)
person.profile = self
end
def to_diaspora_xml def to_diaspora_xml
"<post>"+ self.to_xml.to_s + "</post>" "<post>"+ self.to_xml.to_s + "</post>"
end end

View file

@ -50,10 +50,7 @@ module Diaspora
User.owner.receive_friend_request(p) User.owner.receive_friend_request(p)
#This line checks if the sender was in the database, among other things? #This line checks if the sender was in the database, among other things?
elsif p.is_a? Profile elsif p.is_a? Profile
person = Person.first(:id => p.person_id) puts p.save
person.profile = p
puts person.profile.save
puts person.save
elsif p.respond_to?(:person) && !(p.person.nil?) && !(p.person.is_a? User) #WTF elsif p.respond_to?(:person) && !(p.person.nil?) && !(p.person.is_a? User) #WTF
Rails.logger.info("Saving object with success: #{p.save}") Rails.logger.info("Saving object with success: #{p.save}")
end end