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,9 +12,10 @@ class PhotosController < ApplicationController
|
||||||
if params[:person_id]
|
if params[:person_id]
|
||||||
@person = current_user.contact_for_person_id(params[:person_id])
|
@person = current_user.contact_for_person_id(params[:person_id])
|
||||||
@person = @person.person if @person
|
@person = @person.person if @person
|
||||||
|
else
|
||||||
|
@person = current_user.person
|
||||||
end
|
end
|
||||||
@person ||= current_user.person
|
|
||||||
|
|
||||||
@photos = current_user.visible_posts(:_type => "Photo", :person_id => @person.id)
|
@photos = current_user.visible_posts(:_type => "Photo", :person_id => @person.id)
|
||||||
|
|
||||||
@aspect = :photos
|
@aspect = :photos
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ module Diaspora
|
||||||
end
|
end
|
||||||
|
|
||||||
def contact_for_person_id(person_id)
|
def contact_for_person_id(person_id)
|
||||||
friends.first(:person_id => person_id)
|
friends(:person_id => person_id).first
|
||||||
end
|
end
|
||||||
|
|
||||||
def friends_not_in_aspect( aspect )
|
def friends_not_in_aspect( aspect )
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ describe PhotosController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sets the person to a friend if person_id is set' do
|
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[:person].should == user2.person
|
||||||
assigns[:photos].should == []
|
assigns[:photos].should == []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue