伤不起 的错误.登录后timeline 不见了

This commit is contained in:
2015-12-03 00:00:43 +08:00
parent e6375319cb
commit 5044ea223b
+2 -2
View File
@@ -8,13 +8,13 @@ class EachPostSerializer < ActiveModel::Serializer
end
def first_sharer
user = ShareInstance.where(sharable_id: object.id).first.try(:user)
user = ShareInstance.where(sharable_id: object.id).first.user
user_info_json(user)
end
def last_sharer
return nil if ShareInstance.where(sharable_id: object.id).count == 1
user = ShareInstance.where(sharable_id: object.id).last.try(:user)
user = ShareInstance.where(sharable_id: object.id).last.user
user_info_json(user)
end