MS IZ moved activate_friend to user

This commit is contained in:
maxwell 2010-08-09 11:03:16 -07:00
parent 67843a21e2
commit 8532be1307
2 changed files with 6 additions and 7 deletions

View file

@ -35,12 +35,6 @@ class Request
def activate_friend
from_user = Person.first(:url => self.callback_url).owner
from_user.friends << person
from_user.save
end
def set_pending_friend
p = Person.first(:id => self.person.id)

View file

@ -66,7 +66,7 @@ class User
friend_request.person.serialized_key = friend_request.exported_key
if Request.where(:callback_url => friend_request.callback_url).first
friend_request.activate_friend
activate_friend friend_request.person
Rails.logger.info("#{self.real_name}'s friend request has been accepted")
friend_request.destroy
else
@ -98,6 +98,11 @@ class User
raise "you can't do anything to that url"
end
end
def activate_friend (person)
friends << person
save
end
###Helpers############