MS RS fixed photo show bug
This commit is contained in:
parent
38a1b948ed
commit
4d2820e31c
3 changed files with 5 additions and 4 deletions
|
|
@ -12,8 +12,9 @@ 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)
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ module Diaspora
|
|||
end
|
||||
|
||||
def contact_for_person_id(person_id)
|
||||
friends.first(:person_id => person_id)
|
||||
friends(:person_id => person_id).first
|
||||
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