DG MS debugging friend request

This commit is contained in:
maxwell 2010-07-09 18:41:39 -07:00
parent 8147602570
commit 23057869e1
3 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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"

View file

@ -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