mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 22:50:45 +08:00
25 lines
390 B
Ruby
25 lines
390 B
Ruby
class PostActionUserSerializer < BasicUserSerializer
|
|
attributes :post_url
|
|
|
|
def id
|
|
object.user.id
|
|
end
|
|
|
|
def username
|
|
object.user.username
|
|
end
|
|
|
|
def uploaded_avatar_id
|
|
object.user.uploaded_avatar_id
|
|
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
|