Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
cbabc547a2
3 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -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 == []
|
||||
|
|
|
|||
Loading…
Reference in a new issue