Merge branch 'master' of github.com:diaspora/diaspora_rails into pivots

Conflicts:
	app/models/user.rb
This commit is contained in:
Raphael 2010-08-17 19:34:19 -07:00
commit 456e9e9634
2 changed files with 6 additions and 5 deletions

View file

@ -12,7 +12,7 @@ class PeopleController < ApplicationController
end end
def show def show
@person= current_user.friend_by_id(params[:id]) @person= current_user.visible_person_by_id(params[:id])
@person_profile = @person.profile @person_profile = @person.profile
@person_posts = Post.where(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC' @person_posts = Post.where(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC'
@ -21,7 +21,7 @@ class PeopleController < ApplicationController
end end
def destroy def destroy
current_user.unfriend(current_user.friend_by_id(params[:id])) current_user.unfriend(current_user.visible_person_by_id(params[:id]))
flash[:notice] = "unfriended person." flash[:notice] = "unfriended person."
redirect_to people_url redirect_to people_url
end end

View file

@ -236,8 +236,8 @@ class User
if object.is_a? Retraction if object.is_a? Retraction
if object.type == 'Person' && object.signature_valid? if object.type == 'Person' && object.signature_valid?
Rails.logger.info( "the person id is #{object.post_id} the friend found is #{friend_by_id(object.post_id).inspect}") Rails.logger.info( "the person id is #{object.post_id} the friend found is #{visible_person_by_id(object.post_id).inspect}")
unfriended_by friend_by_id(object.post_id) unfriended_by visible_person_by_id(object.post_id)
else else
object.perform self.id object.perform self.id
@ -289,7 +289,8 @@ class User
terse terse
end end
def friend_by_id( id ) def visible_person_by_id( id )
return self if id == self.id
friends.detect{|x| x.id == ensure_bson( id ) } friends.detect{|x| x.id == ensure_bson( id ) }
end end