do not call .photo_count on a reshare etc.

This commit is contained in:
Jonne Haß 2012-01-13 22:09:07 +01:00
parent e1edef9ff1
commit 0cc0b152d7

View file

@ -36,7 +36,7 @@ class Post < ActiveRecord::Base
t.add :user_like t.add :user_like
t.add :mentioned_people t.add :mentioned_people
t.add lambda { |post| t.add lambda { |post|
if post.photos_count > 0 if post.respond_to?(:photos) && post.photos_count > 0
post.photos post.photos
else else
[] []