discourse/app/serializers/post_action_user_serializer.rb

26 lines
412 B
Ruby
Raw Normal View History

class PostActionUserSerializer < BasicUserSerializer
2016-04-01 05:33:25 +08:00
attributes :post_url,
:username_lower
def id
object.user.id
end
def username
object.user.username
end
2016-04-01 05:33:25 +08:00
def username_lower
object.user.username_lower
end
def avatar_template
object.user.avatar_template
end
def post_url
object.related_post.url if object.related_post_id && object.related_post
end
end