Skip to content
Extraits de code Groupes Projets
Valider 4243d8ef rédigé par maxwell's avatar maxwell
Parcourir les fichiers

MS IZ using the particular user's friends in the send_friend_request_to

parent ac7530d1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -31,7 +31,7 @@ class User ...@@ -31,7 +31,7 @@ class User
######### Friend Requesting ######### Friend Requesting
def send_friend_request_to(friend_url) def send_friend_request_to(friend_url)
unless Person.where(:url => friend_url).first unless self.friends.where(:url => friend_url).first
p = Request.instantiate(:to => friend_url, :from => self.person) p = Request.instantiate(:to => friend_url, :from => self.person)
if p.save if p.save
p.push_to_url friend_url p.push_to_url friend_url
......
...@@ -18,3 +18,10 @@ user = User.create( :email => "tom@tom.joindiaspora.com", ...@@ -18,3 +18,10 @@ user = User.create( :email => "tom@tom.joindiaspora.com",
) )
user.person.save user.person.save
user2 = User.create( :email => "korth@tom.joindiaspora.com",
:password => "evankorth",
:person => Person.new( :email => "korth@tom.joindiaspora.com",
:url => "http://tom.joindiaspora.com/",
:profile => Profile.new( :first_name => "Evan",
:last_name => "Korth")))
user2.person.save
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter