2013-04-22 02:45:03 -05:00
|
|
|
class PostActionUserSerializer < BasicUserSerializer
|
2014-05-27 04:43:19 -05:00
|
|
|
attributes :post_url
|
2013-08-14 11:18:54 -05:00
|
|
|
|
|
|
|
def id
|
|
|
|
object.user.id
|
|
|
|
end
|
|
|
|
|
|
|
|
def username
|
|
|
|
object.user.username
|
|
|
|
end
|
|
|
|
|
2014-05-27 04:43:19 -05:00
|
|
|
def uploaded_avatar_id
|
|
|
|
object.user.uploaded_avatar_id
|
|
|
|
end
|
|
|
|
|
2013-08-14 11:18:54 -05:00
|
|
|
def avatar_template
|
|
|
|
object.user.avatar_template
|
|
|
|
end
|
2013-04-22 02:45:03 -05:00
|
|
|
|
|
|
|
def post_url
|
2013-09-10 20:24:42 -05:00
|
|
|
object.related_post.url if object.related_post_id && object.related_post
|
2013-04-22 02:45:03 -05:00
|
|
|
end
|
2013-08-14 11:18:54 -05:00
|
|
|
|
2013-04-22 02:45:03 -05:00
|
|
|
end
|