fixed 500 on photos#show for private photos and logged out user

This commit is contained in:
Jonne Hass 2011-11-10 19:30:46 +01:00
parent cfbc2b7546
commit 10fa7ba024

View file

@ -144,7 +144,7 @@ class PhotosController < ApplicationController
if user_signed_in?
@photo = current_user.find_visible_shareable_by_id(Photo, params[:id])
else
@photo = Photo.where(id => params[:id], :public => true)
@photo = Photo.where(:id => params[:id], :public => true).first
end
if @photo