FIX: Move title and name out of BasicUserSerializer.

This commit is contained in:
Guo Xiang Tan 2016-12-05 18:46:23 +08:00
parent 9f3eaf4c95
commit bea0856f1c
3 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,5 @@
class BasicUserSerializer < ApplicationSerializer
attributes :id, :username, :avatar_template, :title, :name
attributes :id, :username, :avatar_template
def include_name?
SiteSetting.enable_names?

View File

@ -6,7 +6,7 @@ class GroupPostSerializer < ApplicationSerializer
:url,
:category
has_one :user, serializer: BasicUserSerializer, embed: :object
has_one :user, serializer: GroupPostUserSerializer, embed: :object
has_one :topic, serializer: BasicTopicSerializer, embed: :object
def title

View File

@ -0,0 +1,3 @@
class GroupPostUserSerializer < BasicUserSerializer
attributes :title, :name
end