Merge branch 'master' of github.com:diaspora/diaspora

This commit is contained in:
zhitomirskiyi 2010-11-08 15:10:32 -08:00
commit cbabc547a2
3 changed files with 6 additions and 4 deletions

View file

@ -12,9 +12,10 @@ class PhotosController < ApplicationController
if params[:person_id]
@person = current_user.contact_for_person_id(params[:person_id])
@person = @person.person if @person
else
@person = current_user.person
end
@person ||= current_user.person
@photos = current_user.visible_posts(:_type => "Photo", :person_id => @person.id)
@aspect = :photos

View file

@ -42,7 +42,8 @@ module Diaspora
end
def contact_for_person_id(person_id)
friends.first(:person_id => person_id)
friends.first(:person_id => person_id.to_id) if person_id
end
def friends_not_in_aspect( aspect )

View file

@ -42,7 +42,7 @@ describe PhotosController do
end
it 'sets the person to a friend if person_id is set' do
get :index, :person_id => user2.person.id
get :index, :person_id => user2.person.id.to_s
assigns[:person].should == user2.person
assigns[:photos].should == []