Right. It happens if you put in the idd manually
Sent via BlackBerry by AT&T

-----Original Message-----
From: Bruno Bornsztein <[email protected]>

Date: Tue, 7 Apr 2009 09:51:15 
To: <[email protected]>
Subject: [CommunityEngine] Re: Boritz: Suggested improvement to 
 photos_controller#show


I'm not seeing this behavior. Perhaps it you have some local modifications
that are causing this?
If you look in you photos table, you should see that the thumbnailed photos
don't have a user_id assigned, which means they shouldn't come up in
photo.previous_photo or next_photo.

Thanks,
Bruno

On Sat, Apr 4, 2009 at 12:24 PM, sprite <[email protected]> wrote:

>
> Needed a similar fix in comments_controller#index
>
>  def index
>
>    @commentable = comment_type.constantize.find(comment_id)
>
>    if comment_type == 'Photo'
>      @commentable = @commentable.parent if @commentable.parent
>    end
>
>
> On Apr 1, 5:33 pm, sprite <[email protected]> wrote:
> > Meant Bornsztein no idea why I typed Boritz... Sorry.
> >
> > On Apr 1, 5:29 pm, sprite <[email protected]> wrote:
> >
> > > Just a recommendation. I noticed the behavior on TennisMetro.com is
> > > the same. Since for each picture you upload it generates 3 thumbnails,
> > > if you try to view those through show it causes a server error.
> > > (Crashes on @photo.previous_photo)
> >
> > > I ended up doing this
> >
> > >   def show
> > >     @photo = Photo.find(params[:id])
> > >     @photo = @photo.parent if @photo.parent # If this is a thumbnail
> > > set the photo to the parent pic.
> > >     if @photo
> > >       @user = @photo.user
> > >       @album = @photo.album
> > >       @is_current_user = @user.eql?(current_user)
> > >       @comment = Comment.new(params[:comment])
> >
> > >       @previous = @photo.previous_photo
> > >       @next = @photo.next_photo
> > >       @related = Photo.find_related_to(@photo)
> >
> > >      respond_to do |format|
> > >         format.html # show.rhtml
> > >      end
> > >     end
> >
> > >     rescue ActiveRecord::RecordNotFound
> > >       flash[:error] = "The picture was not found."
> > >       redirect_to :controller => 'base', :action => 'site_index'
> > >   end
> >
> > > Of course your code will be slightly different since you don't have
> > > albums.
> >
>




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CommunityEngine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/communityengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to