DG MS debugging friend request
This commit is contained in:
parent
8147602570
commit
23057869e1
3 changed files with 4 additions and 4 deletions
|
|
@ -12,8 +12,7 @@ class PeopleController < ApplicationController
|
|||
end
|
||||
|
||||
def destroy
|
||||
@person = Person.where(:id => params[:id]).first
|
||||
@person.destroy
|
||||
current_user.unfriend(params[:id])
|
||||
flash[:notice] = "Successfully destroyed person."
|
||||
redirect_to people_url
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class RequestsController < ApplicationController
|
|||
def destroy
|
||||
if params[:accept]
|
||||
current_user.accept_friend_request params[:id]
|
||||
flash[:notice] = "you are now friends with #{@request.person.real_name}"
|
||||
flash[:notice] = "you are now friends"
|
||||
else
|
||||
current_user.ignore_friend_request params[:id]
|
||||
flash[:notice] = "ignored friend request"
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@ class User < Person
|
|||
def send_friend_request_to(friend_url)
|
||||
unless Person.where(:url => friend_url).first
|
||||
p = Request.instantiate(:to => friend_url, :from => self)
|
||||
puts p.inspect
|
||||
if p.save
|
||||
p.push_to_url friend_url
|
||||
p
|
||||
end
|
||||
p
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue