do not call .photo_count on a reshare etc.
This commit is contained in:
parent
e1edef9ff1
commit
0cc0b152d7
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||||
[]
|
[]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue