MS IZ moved activate_friend to user
This commit is contained in:
parent
67843a21e2
commit
8532be1307
2 changed files with 6 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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############
|
||||
|
|
|
|||
Loading…
Reference in a new issue